Skip to content

Commit 63c2ef8

Browse files
style fixes
1 parent 51aee8c commit 63c2ef8

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

specs/IFramePermissionRequested.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ off of the top level iframe.
4141
# Examples
4242
## C++: Registering IFrame Permission Requested Handler
4343
``` cpp
44+
AppWindow* m_appWindow;
4445
wil::com_ptr<ICoreWebView2> m_webview;
4546
std::map<std::tuple<std::wstring, COREWEBVIEW2_PERMISSION_KIND, BOOL>, bool>
4647
m_cachedPermissions;
@@ -77,7 +78,8 @@ void RegisterIFramePermissionRequestedHandler()
7778
// in the permission requested event handler by showing the
7879
// dialog via lambda run asynchronously outside of this event
7980
// handler.
80-
auto showDialog = [this, args] {
81+
auto showDialog = [this, args]
82+
{
8183
COREWEBVIEW2_PERMISSION_KIND kind =
8284
COREWEBVIEW2_PERMISSION_KIND_UNKNOWN_PERMISSION;
8385
BOOL userInitiated = FALSE;
@@ -154,7 +156,8 @@ void RegisterIFramePermissionRequestedHandler()
154156
wil::com_ptr<ICoreWebView2Deferral> deferral;
155157
CHECK_FAILURE(args->GetDeferral(&deferral));
156158

157-
m_appWindow->RunAsync([deferral, showDialog]() {
159+
m_appWindow->RunAsync([deferral, showDialog]()
160+
{
158161
showDialog();
159162
CHECK_FAILURE(deferral->Complete());
160163
});
@@ -233,7 +236,8 @@ void RegisterIFramePermissionRequestedHandler()
233236
// We avoid potential reentrancy from running a message loop
234237
// in the permission requested event handler by showing the
235238
// dialog asynchronously.
236-
System.Threading.SynchronizationContext.Current.Post((_) => {
239+
System.Threading.SynchronizationContext.Current.Post((_) =>
240+
{
237241
using (deferral)
238242
{
239243
var cachedKey = Tuple.Create(permissionArgs.Uri,
@@ -347,8 +351,8 @@ interface ICoreWebView2FramePermissionRequestedEventArgs2;
347351
[uuid(3ed01620-13fc-4c2c-9eb9-62fccd689093), object, pointer_default(unique)]
348352
interface ICoreWebView2Frame2 : ICoreWebView2Frame {
349353
/// Add an event handler for the `PermissionRequested` event.
350-
/// `PermissionRequested` is raised when content in an iframe requests
351-
/// permission to access some priveleged resources.
354+
/// `PermissionRequested` is raised when content in an iframe any of its
355+
/// descendant iframes requests permission to priveleged resources.
352356
///
353357
/// This relates to the `PermissionRequested` event on the `CoreWebView2`.
354358
/// Both these events will be raised in the case of an iframe requesting
@@ -420,7 +424,7 @@ namespace Microsoft.Web.WebView2.Core
420424
[interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2Frame2")]
421425
{
422426
// ICoreWebView2Frame2 members
423-
[doc_string("PermissionRequested is raised when content in an IFrame requests permission to access some priveleged resources.\nIf a deferral is not taken on the event args, the subsequent scripts are blocked until the event handler returns. If a deferral is taken, the scripts are blocked until the deferral is completed.")]
427+
[doc_string("PermissionRequested is raised when content in an iframe or any of its descendant iframes requests permission to access some priveleged resources.\nIf a deferral is not taken on the event args, the subsequent scripts are blocked until the event handler returns. If a deferral is taken, the scripts are blocked until the deferral is completed.")]
424428
event Windows.Foundation.TypedEventHandler<CoreWebView2Frame, CoreWebView2PermissionRequestedEventArgs> PermissionRequested;
425429
}
426430

0 commit comments

Comments
 (0)