Bug 216821 - Implement a default prompt for getUserMedia
Summary: Implement a default prompt for getUserMedia
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-22 04:04 PDT by youenn fablet
Modified: 2020-09-22 09:32 PDT (History)
8 users (show)

See Also:


Attachments
Patch (29.86 KB, patch)
2020-09-22 04:08 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (28.15 KB, patch)
2020-09-22 08:53 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2020-09-22 04:04:06 PDT
Implement a default prompt for getUserMedia
Comment 1 youenn fablet 2020-09-22 04:08:35 PDT
Created attachment 409355 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2020-09-22 04:10:34 PDT
<rdar://problem/69362300>
Comment 3 Eric Carlson 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
Comment 4 youenn fablet 2020-09-22 08:53:38 PDT
Created attachment 409365 [details]
Patch for landing
Comment 5 EWS 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].