[webkit-reviews] review granted: [Bug 216821] Implement a default prompt for getUserMedia : [Attachment 409355] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 22 08:41:44 PDT 2020


Eric Carlson <eric.carlson at apple.com> has granted youenn fablet
<youennf at gmail.com>'s request for review:
Bug 216821: Implement a default prompt for getUserMedia
https://bugs.webkit.org/show_bug.cgi?id=216821

Attachment 409355: Patch

https://bugs.webkit.org/attachment.cgi?id=409355&action=review




--- Comment #3 from Eric Carlson <eric.carlson at apple.com> ---
Comment on attachment 409355
  --> https://bugs.webkit.org/attachment.cgi?id=409355
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=409355&action=review

> Source/WebKit/UIProcess/Cocoa/WKUserMediaCaptureAccessAlert.mm:138
> +/*
> +#if PLATFORM(MAC)
> +    auto alert = adoptNS([NSAlert new]);
> +    [alert setMessageText:alertTitle];
> +    [alert setInformativeText:informativeText];
> +    [alert addButtonWithTitle:allowButtonString];
> +    [alert addButtonWithTitle:doNotAllowButtonString];
> +    [alert beginSheetModalForWindow:webView.window
completionHandler:[completionBlock](NSModalResponse returnCode) {
> +	   auto shouldAllow = returnCode == NSAlertFirstButtonReturn;
> +	   completionBlock(shouldAllow);
> +    }];
> +#else
> +    UIAlertController* alert = [UIAlertController
alertControllerWithTitle:alertMessage message:nil
preferredStyle:UIAlertControllerStyleAlert];
> +
> +    auto completionBlock = makeBlockPtr([completionHandler =
WTFMove(completionHandler)](bool shouldAllow) mutable {
> +	   completionHandler(shouldAllow);
> +    });
> +
> +    NSString *cancelButtonString = WEB_UI_STRING_KEY(@"Donât Allow", "Donât
Allow (usermedia)", @"Disallow button title in user media prompt");
> +    UIAlertAction* cancelAction = [UIAlertAction
actionWithTitle:cancelButtonString style:UIAlertActionStyleCancel
handler:[completionBlock](UIAlertAction *action) {
> +	   completionBlock(false);
> +    }];
> +
> +    NSString *allowButtonString = WEB_UI_STRING_KEY(@"Allow", "Allow
(usermedia)", @"Allow button title in user media prompt");
> +
> +
> +    UIAlertAction* allowAction = [UIAlertAction
actionWithTitle:allowButtonString style:UIAlertActionStyleDefault
handler:[completionBlock](UIAlertAction *action) {
> +	   completionBlock(true);
> +    }];
> +    [alert addAction:cancelAction];
> +    [alert addAction:allowAction];
> +
> +    [[UIViewController
_viewControllerForFullScreenPresentationFromView:view]
presentViewController:alert animated:YES completion:nil];
> +#endif
> + */

This isn't needed


More information about the webkit-reviews mailing list