RESOLVED FIXED 216821
Implement a default prompt for getUserMedia
https://bugs.webkit.org/show_bug.cgi?id=216821
Summary Implement a default prompt for getUserMedia
youenn fablet
Reported 2020-09-22 04:04:06 PDT
Implement a default prompt for getUserMedia
Attachments
Patch (29.86 KB, patch)
2020-09-22 04:08 PDT, youenn fablet
no flags
Patch for landing (28.15 KB, patch)
2020-09-22 08:53 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2020-09-22 04:08:35 PDT
Radar WebKit Bug Importer
Comment 2 2020-09-22 04:10:34 PDT
Eric Carlson
Comment 3 2020-09-22 08:41:44 PDT
Comment on attachment 409355 [details] 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
youenn fablet
Comment 4 2020-09-22 08:53:38 PDT
Created attachment 409365 [details] Patch for landing
EWS
Comment 5 2020-09-22 09:32:16 PDT
Committed r267414: <https://trac.webkit.org/changeset/267414> All reviewed patches have been landed. Closing bug and clearing flags on attachment 409365 [details].
Note You need to log in before you can comment on or make changes to this bug.