Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Issue 2666523002: Allow permission bubbles to participate in key event dispatch as if they were a Browser. (Closed)

Created:
3 years, 10 months ago by tapted
Modified:
3 years, 10 months ago
Reviewers:
Robert Sesek, raymes
CC:
chromium-reviews, mac-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow permission bubbles to participate in key event dispatch as if they were a Browser. Accomplish this by allowing the `CommandDispatcher` we use for ChomeEventProcessingWindows to bubble up key handling, and command validation/dispatch. Dispatch goes up to a parent window's CommandDispatcher when certain conditions are met. Currently all ChomeEventProcessingWindows and Views' NativeWidgetMacNSWindows have a CommandDispatcher, but only browser windows provide a CommandHandler. By asking the CommandHandler in the parent window, we can validate commands in the mainMenu, then forward the -commandDispatch: action from the menu item when NSMenu calls it on the key window (which might not be a browser). Adds a rather fun interactive UI test for this that runs with Views and Cocoa permissions bubbles, and tests commands dispatched via the mainMenu (Cmd+w, Cmd+Alt+Left) and performKeyEquivalent (Cmd+Shift+'{') BUG=603881, 679339 Review-Url: https://codereview.chromium.org/2666523002 Cr-Commit-Position: refs/heads/master@{#447864} Committed: https://chromium.googlesource.com/chromium/src/+/e91c25b113011f055428c46609e19ce6550b41ea

Patch Set 1 #

Patch Set 2 : tests complete #

Patch Set 3 : Better, and fixes mac views as well \o/ #

Patch Set 4 : Parameterize test, Comments, nits #

Total comments: 6

Patch Set 5 : comments, fix permission->type missed in a refactor #

Unified diffs Side-by-side diffs Delta from patch set Stats (+421 lines, -76 lines) Patch
M chrome/browser/permissions/permission_request_manager.h View 1 2 chunks +8 lines, -1 line 0 comments Download
A chrome/browser/permissions/permission_request_manager_test_api.h View 1 1 chunk +44 lines, -0 lines 0 comments Download
A chrome/browser/permissions/permission_request_manager_test_api.cc View 1 2 3 4 1 chunk +63 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/chrome_event_processing_window.mm View 1 2 2 chunks +10 lines, -16 lines 0 comments Download
A chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa_interactive_uitest.mm View 1 2 3 4 1 chunk +179 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm View 1 2 2 chunks +6 lines, -37 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 chunks +3 lines, -0 lines 0 comments Download
M ui/base/cocoa/command_dispatcher.h View 1 2 3 3 chunks +15 lines, -0 lines 0 comments Download
M ui/base/cocoa/command_dispatcher.mm View 1 2 3 4 4 chunks +83 lines, -5 lines 0 comments Download
M ui/views/cocoa/native_widget_mac_nswindow.mm View 1 2 3 1 chunk +10 lines, -17 lines 0 comments Download

Messages

Total messages: 47 (39 generated)
tapted
Hi Robert and Raymes, please take a look. - Robert for the Cocoa stuff - ...
3 years, 10 months ago (2017-02-01 10:35:01 UTC) #28
Robert Sesek
https://codereview.chromium.org/2666523002/diff/130001/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa_interactive_uitest.mm File chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa_interactive_uitest.mm (right): https://codereview.chromium.org/2666523002/diff/130001/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa_interactive_uitest.mm#newcode37 chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa_interactive_uitest.mm:37: public ::testing::WithParamInterface<UiMode> { Great test! https://codereview.chromium.org/2666523002/diff/130001/ui/base/cocoa/command_dispatcher.mm File ui/base/cocoa/command_dispatcher.mm (right): ...
3 years, 10 months ago (2017-02-01 14:27:20 UTC) #29
raymes
chrome/browser/permissions lgtm I also took a rough look at chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa_interactive_uitest.mm and didn't see any problems. ...
3 years, 10 months ago (2017-02-01 18:33:27 UTC) #30
tapted
https://codereview.chromium.org/2666523002/diff/130001/ui/base/cocoa/command_dispatcher.mm File ui/base/cocoa/command_dispatcher.mm (right): https://codereview.chromium.org/2666523002/diff/130001/ui/base/cocoa/command_dispatcher.mm#newcode118 ui/base/cocoa/command_dispatcher.mm:118: if (handler) On 2017/02/01 14:27:20, Robert Sesek wrote: > ...
3 years, 10 months ago (2017-02-01 23:36:01 UTC) #37
Robert Sesek
LGTM. I think I follow that…
3 years, 10 months ago (2017-02-02 17:37:53 UTC) #40
tapted
On 2017/02/02 17:37:53, Robert Sesek wrote: > LGTM. I think I follow that… Yah, it's ...
3 years, 10 months ago (2017-02-02 22:35:39 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2666523002/170001
3 years, 10 months ago (2017-02-02 22:36:49 UTC) #44
commit-bot: I haz the power
3 years, 10 months ago (2017-02-02 22:45:06 UTC) #47
Message was sent while issue was closed.
Committed patchset #5 (id:170001) as
https://chromium.googlesource.com/chromium/src/+/e91c25b113011f055428c46609e1...

Powered by Google App Engine
This is Rietveld 408576698