| Summary: | Implement a default prompt for getUserMedia | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | youenn fablet <youennf> | ||||||
| Component: | WebRTC | Assignee: | youenn fablet <youennf> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | eric.carlson, ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer, youennf | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Local Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
youenn fablet
2020-09-22 04:04:06 PDT
Created attachment 409355 [details]
Patch
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 Created attachment 409365 [details]
Patch for landing
Committed r267414: <https://trac.webkit.org/changeset/267414> All reviewed patches have been landed. Closing bug and clearing flags on attachment 409365 [details]. |