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

Issue 109413003: Refactor GlobalShortcutListener. (Closed)

Created:
7 years ago by zhchbin
Modified:
6 years, 11 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, Boris Smus
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Refactor GlobalShortcutListener. 1. Move method [Start/Stop]Listening from public to private. 2. The change of relationship between accelerator and observer: from "one-to-many" to "one to one". 3. Better name: use suffix "Impl" for the platform-specified implementation methods: |RegisterAcceleratorImpl| and |UnregisterAcceleratorImpl|. BUG=329616, 302437 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=242995

Patch Set 1 #

Patch Set 2 : Stuff of other platforms. [Havn't compiled yet.] #

Patch Set 3 : Fix linux keyboard code transfrom. #

Total comments: 20

Patch Set 4 : Address comments. #

Patch Set 5 : Update as comments. #

Total comments: 3

Patch Set 6 : #

Patch Set 7 : Clearer. #

Total comments: 2

Patch Set 8 : Clearer logic. #

Total comments: 57

Patch Set 9 : Address Mark's comments. #

Total comments: 27

Patch Set 10 : Another round #

Patch Set 11 : sync. #

Patch Set 12 : Sync. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+198 lines, -256 lines) Patch
M chrome/browser/extensions/extension_commands_global_registry.cc View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -11 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener.h View 1 2 3 4 5 6 7 8 9 3 chunks +32 lines, -17 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener.cc View 1 2 3 4 5 6 7 8 9 2 chunks +36 lines, -22 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_chromeos.h View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -15 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_chromeos.cc View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -22 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_mac.h View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -12 lines 0 comments Download
D chrome/browser/extensions/global_shortcut_listener_mac.cc View 1 2 3 4 5 6 7 8 0 chunks +-1 lines, --1 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_mac.mm View 1 2 3 4 5 6 7 8 9 7 chunks +16 lines, -25 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_ozone.h View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -15 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_ozone.cc View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -22 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_win.h View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -17 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_win.cc View 1 2 3 4 5 6 7 8 9 4 chunks +12 lines, -30 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_x11.h View 1 2 3 4 5 6 7 8 9 2 chunks +17 lines, -20 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_x11.cc View 1 2 3 4 5 6 7 8 9 5 chunks +22 lines, -29 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
zhchbin
Finnur, please help me start try bot jobs. This is a refactor of GlobalShortcutListener, according ...
7 years ago (2013-12-16 03:12:15 UTC) #1
Finnur
On 2013/12/16 03:12:15, zhchbin wrote: > Finnur, please help me start try bot jobs. > ...
7 years ago (2013-12-16 21:02:59 UTC) #2
Finnur
Wasn't there a bug filed for the cleanup specifically? Maybe add that to the BUG= ...
7 years ago (2013-12-17 09:58:30 UTC) #3
zhchbin
> Wasn't there a bug filed for the cleanup specifically? > Maybe add that to ...
7 years ago (2013-12-17 11:21:47 UTC) #4
zhchbin
https://codereview.chromium.org/109413003/diff/40001/chrome/browser/extensions/global_shortcut_listener.h File chrome/browser/extensions/global_shortcut_listener.h (right): https://codereview.chromium.org/109413003/diff/40001/chrome/browser/extensions/global_shortcut_listener.h#newcode37 chrome/browser/extensions/global_shortcut_listener.h:37: virtual bool RegisterAccelerator( s/or now/or not s/do not care/doesn't ...
7 years ago (2013-12-17 11:24:47 UTC) #5
Finnur
https://codereview.chromium.org/109413003/diff/40001/chrome/browser/extensions/global_shortcut_listener.h File chrome/browser/extensions/global_shortcut_listener.h (right): https://codereview.chromium.org/109413003/diff/40001/chrome/browser/extensions/global_shortcut_listener.h#newcode37 chrome/browser/extensions/global_shortcut_listener.h:37: virtual bool RegisterAccelerator( OK, so if RegisterAccelerator fails then ...
7 years ago (2013-12-17 11:47:25 UTC) #6
zhchbin
https://codereview.chromium.org/109413003/diff/40001/chrome/browser/extensions/global_shortcut_listener.h File chrome/browser/extensions/global_shortcut_listener.h (right): https://codereview.chromium.org/109413003/diff/40001/chrome/browser/extensions/global_shortcut_listener.h#newcode37 chrome/browser/extensions/global_shortcut_listener.h:37: virtual bool RegisterAccelerator( On 2013/12/17 11:47:25, Finnur wrote: > ...
7 years ago (2013-12-17 13:34:31 UTC) #7
Finnur
https://codereview.chromium.org/109413003/diff/40001/chrome/browser/extensions/global_shortcut_listener.h File chrome/browser/extensions/global_shortcut_listener.h (right): https://codereview.chromium.org/109413003/diff/40001/chrome/browser/extensions/global_shortcut_listener.h#newcode37 chrome/browser/extensions/global_shortcut_listener.h:37: virtual bool RegisterAccelerator( > However, the code I just ...
7 years ago (2013-12-17 14:31:39 UTC) #8
zhchbin
https://codereview.chromium.org/109413003/diff/40001/chrome/browser/extensions/global_shortcut_listener_win.cc File chrome/browser/extensions/global_shortcut_listener_win.cc (right): https://codereview.chromium.org/109413003/diff/40001/chrome/browser/extensions/global_shortcut_listener_win.cc#newcode74 chrome/browser/extensions/global_shortcut_listener_win.cc:74: DCHECK(hotkey_ids_.find(accelerator) == hotkey_ids_.end()); On 2013/12/17 14:31:39, Finnur wrote: > ...
7 years ago (2013-12-17 15:15:46 UTC) #9
Finnur
https://codereview.chromium.org/109413003/diff/120001/chrome/browser/extensions/extension_commands_global_registry.cc File chrome/browser/extensions/extension_commands_global_registry.cc (right): https://codereview.chromium.org/109413003/diff/120001/chrome/browser/extensions/extension_commands_global_registry.cc#newcode95 chrome/browser/extensions/extension_commands_global_registry.cc:95: } Good catch. But I think a better alternative ...
7 years ago (2013-12-17 16:35:44 UTC) #10
zhchbin
https://codereview.chromium.org/109413003/diff/120001/chrome/browser/extensions/extension_commands_global_registry.cc File chrome/browser/extensions/extension_commands_global_registry.cc (right): https://codereview.chromium.org/109413003/diff/120001/chrome/browser/extensions/extension_commands_global_registry.cc#newcode95 chrome/browser/extensions/extension_commands_global_registry.cc:95: } On 2013/12/17 16:35:45, Finnur wrote: > Good catch. ...
7 years ago (2013-12-18 01:53:07 UTC) #11
Finnur
LGTM
7 years ago (2013-12-19 11:17:48 UTC) #12
zhchbin
Mark, please review the refactor of GlobalShortcutListener. Elliot, please take a look at the change ...
7 years ago (2013-12-19 11:54:38 UTC) #13
Mark Mentovai
Additionally, how about the thread CHECKs that I proposed? https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc File chrome/browser/extensions/extension_commands_global_registry.cc (right): https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc#newcode91 chrome/browser/extensions/extension_commands_global_registry.cc:91: ...
7 years ago (2013-12-19 15:24:12 UTC) #14
Finnur
https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc File chrome/browser/extensions/extension_commands_global_registry.cc (right): https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc#newcode91 chrome/browser/extensions/extension_commands_global_registry.cc:91: DCHECK_EQ(1u, event_targets_[accelerator].size()); When you set a shortcut the current ...
7 years ago (2013-12-19 15:40:39 UTC) #15
zhchbin
Mark, I will sync the code and address your comments tomorrow! Now it's midnight in ...
7 years ago (2013-12-19 15:41:45 UTC) #16
Mark Mentovai
https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc File chrome/browser/extensions/extension_commands_global_registry.cc (right): https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc#newcode86 chrome/browser/extensions/extension_commands_global_registry.cc:86: event_targets_[accelerator].push_back( Protected data members that are maintained by a ...
7 years ago (2013-12-19 18:00:28 UTC) #17
Finnur
https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc File chrome/browser/extensions/extension_commands_global_registry.cc (right): https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc#newcode86 chrome/browser/extensions/extension_commands_global_registry.cc:86: event_targets_[accelerator].push_back( Glad you are reviewing this... :) I guess ...
7 years ago (2013-12-19 19:59:13 UTC) #18
Mark Mentovai
As far as I’m concerned, expanding the fixes to include extension_commands_global_registry.h and its other subclasses ...
7 years ago (2013-12-19 20:15:42 UTC) #19
Mark Mentovai
https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc File chrome/browser/extensions/extension_commands_global_registry.cc (right): https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc#newcode8 chrome/browser/extensions/extension_commands_global_registry.cc:8: #include "chrome/browser/chrome_notification_types.h" This isn’t used in here. https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc#newcode10 chrome/browser/extensions/extension_commands_global_registry.cc:10: ...
7 years ago (2013-12-19 21:03:17 UTC) #20
zhchbin
Please take a look again. The code has synced with Finnur's CL: https://codereview.chromium.org/105713005. https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc File ...
7 years ago (2013-12-20 09:13:12 UTC) #21
Mark Mentovai
This is already much easier to follow, more maintainable, and a stronger design. Great! https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc ...
7 years ago (2013-12-20 17:54:46 UTC) #22
zhchbin
https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc File chrome/browser/extensions/extension_commands_global_registry.cc (right): https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc#newcode41 chrome/browser/extensions/extension_commands_global_registry.cc:41: return &g_factory.Get(); On 2013/12/20 17:54:47, Mark Mentovai wrote: > ...
7 years ago (2013-12-21 09:10:24 UTC) #23
Mark Mentovai
LGTM. Happy new year! https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc File chrome/browser/extensions/extension_commands_global_registry.cc (right): https://codereview.chromium.org/109413003/diff/140001/chrome/browser/extensions/extension_commands_global_registry.cc#newcode41 chrome/browser/extensions/extension_commands_global_registry.cc:41: return &g_factory.Get(); zhchbin wrote: > ...
6 years, 11 months ago (2014-01-02 17:42:35 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zhchbin@gmail.com/109413003/370001
6 years, 11 months ago (2014-01-03 04:21:02 UTC) #25
zhchbin
On 2014/01/02 17:42:35, Mark Mentovai wrote: > LGTM. Happy new year! Thanks for the review! ...
6 years, 11 months ago (2014-01-03 04:33:53 UTC) #26
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) chromedriver2_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=207317
6 years, 11 months ago (2014-01-03 05:04:47 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zhchbin@gmail.com/109413003/370001
6 years, 11 months ago (2014-01-03 05:07:34 UTC) #28
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) chromedriver2_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=209443
6 years, 11 months ago (2014-01-03 05:59:15 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zhchbin@gmail.com/109413003/370001
6 years, 11 months ago (2014-01-03 06:46:06 UTC) #30
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) chromedriver2_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=209458
6 years, 11 months ago (2014-01-03 07:22:39 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zhchbin@gmail.com/109413003/370001
6 years, 11 months ago (2014-01-03 08:08:41 UTC) #32
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) chromedriver2_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=209473
6 years, 11 months ago (2014-01-03 08:53:09 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zhchbin@gmail.com/109413003/370001
6 years, 11 months ago (2014-01-03 14:09:04 UTC) #34
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) chromedriver2_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=207399
6 years, 11 months ago (2014-01-03 15:00:12 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zhchbin@gmail.com/109413003/370001
6 years, 11 months ago (2014-01-04 01:52:25 UTC) #36
commit-bot: I haz the power
6 years, 11 months ago (2014-01-04 03:31:28 UTC) #37
Message was sent while issue was closed.
Change committed as 242995

Powered by Google App Engine
This is Rietveld 408576698