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

Issue 1255783002: [Mac] Factor out keyboard shortcut handling from ChromeEventProcessingWindow. (Closed)

Created:
5 years, 5 months ago by jackhou1
Modified:
5 years, 3 months ago
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@execute
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Mac] Factor out keyboard shortcut handling from ChromeEventProcessingWindow. This pulls the redispatching logic into CommandDispatcher which allows it to be reused independent of Chrome, and is a major step towards enabling keyboard shortcuts in MacViews. By using CommandDispatcher in NativeWidgetMacNSWindow, main menu key equivalents (e.g. Cmd+c) now work when the WebContents has focus. Chrome-specific parts are moved to ChromeCommandDispatcherDelegate, which will, in future, also be used by the Views browser in mac_views_browser=1 builds. This includes minor changes to webview_example to demo command redispatch in non-Chrome Views. E.g. Cmd+q now works in views_examples_with_content_exe when the webview is focused. Some test coverage is provided by GlobalKeyboardShortcutsTest. BUG=508438, 504677 TEST=All keyboard shortcuts continue to work as before. Committed: https://crrev.com/4c458c5afb65ce9bb7c4f3b1825825db0a4540a0 Cr-Commit-Position: refs/heads/master@{#346530}

Patch Set 1 #

Patch Set 2 : Pass native -performKeyEquivalent as block. #

Patch Set 3 : Sync and rebase. #

Patch Set 4 : Sync #

Patch Set 5 : Sync #

Patch Set 6 : Fix a few things. #

Total comments: 23

Patch Set 7 : Address comments. #

Patch Set 8 : Separate CommandDispatcher and CommandDispatcherDelegate. #

Total comments: 9

Patch Set 9 : Address comments. #

Total comments: 46

Patch Set 10 : Address comments. #

Patch Set 11 : Similarity=30 #

Total comments: 6

Patch Set 12 : Address comments. #

Total comments: 22

Patch Set 13 : Address comments. #

Patch Set 14 : Oops missed one. #

Patch Set 15 : And a couple more minor comment nits. #

Total comments: 8

Patch Set 16 : Address comments. #

Patch Set 17 : Minor comment fix. #

Total comments: 2

Patch Set 18 : Address comments. #

Patch Set 19 : UI_BASE_EXPORT CommandDispatcher #

Unified diffs Side-by-side diffs Delta from patch set Stats (+293 lines, -411 lines) Patch
A chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +23 lines, -0 lines 0 comments Download
A + chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.mm View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +24 lines, -105 lines 0 comments Download
M chrome/browser/ui/cocoa/chrome_event_processing_window.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +6 lines, -16 lines 0 comments Download
M chrome/browser/ui/cocoa/chrome_event_processing_window.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +34 lines, -163 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -2 lines 0 comments Download
D content/public/browser/render_widget_host_view_mac_base.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -18 lines 0 comments Download
M ui/base/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
A ui/base/cocoa/command_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +94 lines, -0 lines 0 comments Download
A + ui/base/cocoa/command_dispatcher.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +44 lines, -102 lines 0 comments Download
M ui/base/ui_base.gyp View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M ui/views/cocoa/native_widget_mac_nswindow.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/cocoa/native_widget_mac_nswindow.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +35 lines, -1 line 0 comments Download
M ui/views/controls/webview/unhandled_keyboard_event_handler_mac.mm View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -1 line 0 comments Download
M ui/views/examples/webview_example.h View 1 2 3 4 5 6 7 8 9 3 chunks +9 lines, -1 line 0 comments Download
M ui/views/examples/webview_example.cc View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 33 (6 generated)
jackhou1
tapted, PTAL
5 years, 4 months ago (2015-07-31 01:03:30 UTC) #2
tapted
We need to split the "real" chrome dependencies out of the CommandDispatcher -- these need ...
5 years, 4 months ago (2015-07-31 03:06:50 UTC) #3
jackhou1
On 2015/07/31 03:06:50, tapted wrote: > We need to split the "real" chrome dependencies out ...
5 years, 4 months ago (2015-08-03 06:05:24 UTC) #4
tapted
On 2015/08/03 06:05:24, jackhou1 wrote: > On 2015/07/31 03:06:50, tapted wrote: > > We need ...
5 years, 4 months ago (2015-08-03 06:13:37 UTC) #5
jackhou1
On 2015/08/03 06:13:37, tapted wrote: > On 2015/08/03 06:05:24, jackhou1 wrote: > > On 2015/07/31 ...
5 years, 4 months ago (2015-08-03 06:39:33 UTC) #6
jackhou1
Just addressing the minor comments. https://codereview.chromium.org/1255783002/diff/100001/chrome/browser/ui/cocoa/browser_window_utils.mm File chrome/browser/ui/cocoa/browser_window_utils.mm (right): https://codereview.chromium.org/1255783002/diff/100001/chrome/browser/ui/cocoa/browser_window_utils.mm#newcode52 chrome/browser/ui/cocoa/browser_window_utils.mm:52: if ([command_delegate handleExtraKeyboardShortcut:event window:window]) ...
5 years, 4 months ago (2015-08-04 01:03:59 UTC) #7
jackhou1
tapted, PTAL Patch set 8 has the following separation: - @protocol CommandDispatcher is the NSWindow ...
5 years, 4 months ago (2015-08-18 06:10:29 UTC) #8
tapted
I have more to absorb, but some initial high-level stuff that might make that easier ...
5 years, 4 months ago (2015-08-18 07:22:13 UTC) #9
jackhou1
https://codereview.chromium.org/1255783002/diff/140001/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h File chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h (right): https://codereview.chromium.org/1255783002/diff/140001/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h#newcode19 chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h:19: - (BOOL)handleExtraKeyboardShortcut:(NSEvent*)event window:(NSWindow*)window; On 2015/08/18 07:22:12, tapted wrote: > ...
5 years, 4 months ago (2015-08-25 06:31:12 UTC) #10
tapted
https://codereview.chromium.org/1255783002/diff/140001/ui/base/cocoa/command_dispatcher.h File ui/base/cocoa/command_dispatcher.h (right): https://codereview.chromium.org/1255783002/diff/140001/ui/base/cocoa/command_dispatcher.h#newcode30 ui/base/cocoa/command_dispatcher.h:30: @protocol CommandDispatcher On 2015/08/25 06:31:12, jackhou1 wrote: > On ...
5 years, 3 months ago (2015-08-26 03:04:49 UTC) #11
jackhou1
https://codereview.chromium.org/1255783002/diff/160001/chrome/browser/ui/cocoa/browser_window_utils.mm File chrome/browser/ui/cocoa/browser_window_utils.mm (right): https://codereview.chromium.org/1255783002/diff/160001/chrome/browser/ui/cocoa/browser_window_utils.mm#newcode35 chrome/browser/ui/cocoa/browser_window_utils.mm:35: base::mac::ObjCCastStrict<ChromeEventProcessingWindow>(window); On 2015/08/26 03:04:48, tapted wrote: > (this is ...
5 years, 3 months ago (2015-08-26 06:24:43 UTC) #12
tapted
lgtm (also, I had written this comment before but something ated it): I think there's ...
5 years, 3 months ago (2015-08-26 06:46:54 UTC) #13
jackhou1
> I think there's some coverage provided in the chrome side with a test you ...
5 years, 3 months ago (2015-08-26 07:38:18 UTC) #14
jackhou1
rsesek, please take a look in case you have any comments/suggestions, it's a fairly big ...
5 years, 3 months ago (2015-08-26 07:55:20 UTC) #16
Robert Sesek
https://codereview.chromium.org/1255783002/diff/220001/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h File chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h (right): https://codereview.chromium.org/1255783002/diff/220001/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h#newcode16 chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h:16: // Checks if |event| is a window, delayed window, ...
5 years, 3 months ago (2015-08-26 17:46:50 UTC) #17
jackhou1
https://codereview.chromium.org/1255783002/diff/220001/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h File chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h (right): https://codereview.chromium.org/1255783002/diff/220001/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h#newcode16 chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h:16: // Checks if |event| is a window, delayed window, ...
5 years, 3 months ago (2015-08-27 00:01:25 UTC) #18
jackhou1
rsesek, did you have any other comments?
5 years, 3 months ago (2015-08-27 22:32:50 UTC) #19
Robert Sesek
Sorry, was sitting on some drafts. (Normally because of timezones I'd LG w/ nits this, ...
5 years, 3 months ago (2015-08-27 23:25:23 UTC) #20
jackhou1
> Sorry, was sitting on some drafts. > > (Normally because of timezones I'd LG ...
5 years, 3 months ago (2015-08-28 01:00:47 UTC) #21
Robert Sesek
LGTM w/ a nit https://codereview.chromium.org/1255783002/diff/320001/ui/base/cocoa/command_dispatcher.mm File ui/base/cocoa/command_dispatcher.mm (right): https://codereview.chromium.org/1255783002/diff/320001/ui/base/cocoa/command_dispatcher.mm#newcode75 ui/base/cocoa/command_dispatcher.mm:75: // the |handle*| methods above. ...
5 years, 3 months ago (2015-08-28 19:25:32 UTC) #22
jackhou
https://codereview.chromium.org/1255783002/diff/320001/ui/base/cocoa/command_dispatcher.mm File ui/base/cocoa/command_dispatcher.mm (right): https://codereview.chromium.org/1255783002/diff/320001/ui/base/cocoa/command_dispatcher.mm#newcode75 ui/base/cocoa/command_dispatcher.mm:75: // the |handle*| methods above. On 2015/08/28 19:25:32, Robert ...
5 years, 3 months ago (2015-08-31 07:26:18 UTC) #24
jackhou1
sievers, please review for OWNERS in content/ sky, please review for OWNERS in ui/
5 years, 3 months ago (2015-08-31 07:27:41 UTC) #26
sky
Rubber stamp LGTM as I believe others have reviewed this thoroughly.
5 years, 3 months ago (2015-08-31 15:45:03 UTC) #27
no sievers
content lgtm
5 years, 3 months ago (2015-08-31 19:27:15 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1255783002/360001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1255783002/360001
5 years, 3 months ago (2015-09-01 00:02:19 UTC) #31
commit-bot: I haz the power
Committed patchset #19 (id:360001)
5 years, 3 months ago (2015-09-01 00:08:52 UTC) #32
commit-bot: I haz the power
5 years, 3 months ago (2015-09-01 00:09:39 UTC) #33
Message was sent while issue was closed.
Patchset 19 (id:??) landed as
https://crrev.com/4c458c5afb65ce9bb7c4f3b1825825db0a4540a0
Cr-Commit-Position: refs/heads/master@{#346530}

Powered by Google App Engine
This is Rietveld 408576698