commit | b13ddd23f2696a1a823ee13794cfdb3102d8e9f7 | [log] [tgz] |
---|---|---|
author | Reilly Grant <[email protected]> | Tue Jan 25 20:43:44 2022 |
committer | Chromium LUCI CQ <[email protected]> | Tue Jan 25 20:43:44 2022 |
tree | 99e184c2d6383187ec9a6040f4aee1fc5280c11b | |
parent | 734f4e05fa0e19a6e54177aeea8efadb9d9575bd [diff] [blame] |
Use the origin/name of the main frame in chooser dialogs Permissions dialogs (for WebUSB, WebHID, and Web Serial) should request permission for the main origin (the origin embedding the iframe) and not the site hosting the iframe as per crbug.com/802945. Update the UI code to accurately display the main origin (or extension name) and add tests. Bug: 1280233 Change-Id: Ia3bf9274eb49c1d842e204a518635cc1187f3d3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3353956 Reviewed-by: Scott Violet <[email protected]> Reviewed-by: Andy Paicu <[email protected]> Commit-Queue: Reilly Grant <[email protected]> Cr-Commit-Position: refs/heads/main@{#963184}
diff --git a/chrome/browser/chooser_controller/title_util.cc b/chrome/browser/chooser_controller/title_util.cc index 439247f..7c45abe 100644 --- a/chrome/browser/chooser_controller/title_util.cc +++ b/chrome/browser/chooser_controller/title_util.cc
@@ -22,6 +22,8 @@ int title_string_id_extension) { if (!render_frame_host) return u""; + // Ensure the permission request is attributed to the main frame. + render_frame_host = render_frame_host->GetMainFrame(); #if BUILDFLAG(ENABLE_EXTENSIONS) url::Origin origin = render_frame_host->GetLastCommittedOrigin();