Add in-dialog camera permission request option to payment handler - #12
Merged
stephenmcgruer merged 2 commits intoAug 11, 2026
Merged
Conversation
Currently, the camera test page (camera_test.html) provides two options when camera access is tested: 1. "Start Camera": invokes getUserMedia and renders video to a <video> element. 2. "Grant Camera Access in Popup Window": opens a separate popup window to trigger the permission prompt externally (previously required when payment handler dialogs did not support native permission prompts). To test native permission handling directly inside the payment handler dialog, this change adds a "Grant Camera Access inside this Dialog" link. When clicked, it calls navigator.mediaDevices.getUserMedia() directly within the dialog, stops all tracks immediately upon granting, and updates the permission status UI. The link is visible when camera permission is in 'prompt' or 'denied' state, matching the popup link.
When the kPaymentHandlerCameraAccess or kPaymentHandlerCameraAccessUx feature flag is disabled in Chromium, WebContentsDelegate does not handle camera access requests for payment handler dialogs, and getUserMedia() rejects with NotSupportedError. This CL handles NotSupportedError in camera_test.html by: 1. Dynamically marking camera access as unsupported. 2. Hiding the "Grant Camera Access" links to avoid confusing partners when the feature flag is disabled.
luis-antunes
force-pushed
the
dialog-camera-access
branch
from
August 11, 2026 18:54
508fadd to
632214e
Compare
stephenmcgruer
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a "Grant Camera Access inside this Dialog" option to
camera_test.htmlto test native in-dialog permission prompts, with feature flag gating when unsupported.Changes
getUserMedia()directly inside the payment handler dialog, releases tracks immediately upon granting, and updates permission UI.kPaymentHandlerCameraAccessis disabled,getUserMedia()rejects withNotSupportedError. The page catches this, hides the camera grant options, and notifies the user that the feature flag is disabled.