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

Issue 350943003: Support global keyboard commands on Chrome OS. (Closed)

Created:
6 years, 6 months ago by David Tseng
Modified:
6 years, 5 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Project:
chromium
Visibility:
Public.

Description

Support global keyboard commands on Chrome OS. Currently, AcceleratorController delivers accelerators to GlobalCommandsListenerChromeOS (which is an AcceleratorTarget). We respect the same conditions found within AcceleratorController to disallow shortcuts in specific instances (e.g. login screen locked screen, empty windows). AcceleratorController is owned by the ash::Shell and knows about existing keyboard shortcuts/actions. BUG=336761 TEST=interactive_ui_tests --gtest_filter=GlobalCommandsApiTest.* And, manually, on a desktop build of Chrome with GYP_DEFINES=chromeos=1... with a component extension: Verified that - a global shortcut (ctrl+shift+0) works with focus in 1. web content 2. shelf 3. toolbars (omni box, View(s)). Verified that processing does not occur in the following cases (similarly to most other ash accelerators) as expected: - OOBE - locked screen - desktop with no windows open - sign in screen (after logging out). Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=282110

Patch Set 1 #

Patch Set 2 : Updates to prevent propagation and enable global commands on cros by default. #

Patch Set 3 : Formatting. #

Total comments: 17

Patch Set 4 : Address various comments. #

Total comments: 28

Patch Set 5 : Respond to oshima's comments. #

Patch Set 6 : JS related changes. #

Patch Set 7 : Address oshima's comments. #

Total comments: 1

Patch Set 8 : Omit media keys test. #

Patch Set 9 : Test updates #

Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -119 lines) Patch
M ash/accelerators/accelerator_controller.h View 1 2 3 4 5 6 3 chunks +23 lines, -0 lines 0 comments Download
M ash/accelerators/accelerator_controller.cc View 1 2 3 4 5 6 2 chunks +45 lines, -30 lines 0 comments Download
M chrome/browser/extensions/api/commands/command_service.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/extensions/extension_commands_global_registry_apitest.cc View 1 2 3 4 5 6 7 8 7 chunks +8 lines, -21 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_chromeos.h View 2 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_chromeos.cc View 1 2 3 4 5 6 3 chunks +33 lines, -14 lines 0 comments Download
M chrome/browser/resources/extensions/extension_command_list.js View 1 2 3 4 5 1 chunk +20 lines, -23 lines 0 comments Download
M chrome/common/extensions/command.cc View 1 2 3 4 5 3 chunks +1 line, -7 lines 0 comments Download
M chrome/test/data/extensions/api_test/keybinding/global/background.js View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/keybinding/global/manifest.json View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/common/feature_switch.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
M extensions/common/feature_switch.cc View 1 2 3 4 5 6 7 8 3 chunks +0 lines, -11 lines 0 comments Download
M extensions/common/switches.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
M extensions/common/switches.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 52 (0 generated)
David Tseng
Initial impl. Please take a look. Keyboard commands appear to not work while within the ...
6 years, 6 months ago (2014-06-24 21:18:19 UTC) #1
Finnur
Hmm... We need an altered approach. More on that later. The first line of business, ...
6 years, 6 months ago (2014-06-25 11:08:47 UTC) #2
Finnur
Actually, I may have replied prematurely. I just discovered the call to AcceleratorController on ChromeOS ...
6 years, 6 months ago (2014-06-25 11:13:42 UTC) #3
Finnur
OK, a second reading of the code revealed further review comments were not necessary. On ...
6 years, 6 months ago (2014-06-25 11:28:23 UTC) #4
David Tseng
PTAL. I got this to work with the component extension I was trying this with. ...
6 years, 6 months ago (2014-06-25 19:47:46 UTC) #5
Finnur
First a few comments I have after reading the CL description (before I dig into ...
6 years, 6 months ago (2014-06-26 09:59:29 UTC) #6
Finnur
Code comments below. For tests, see: https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/extensions/extension_commands_global_registry_apitest.cc&q=globalcommands&sq=package:chromium&l=114 ... and ... https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/extensions/extension_commands_global_registry_apitest.cc&q=globalcommands&sq=package:chromium&l=191 Can you do me ...
6 years, 6 months ago (2014-06-26 10:37:35 UTC) #7
David Tseng
First, for your overall comments... 1) First two lines have quite bit redundancy built in. ...
6 years, 6 months ago (2014-06-27 00:14:52 UTC) #8
David Tseng
https://codereview.chromium.org/350943003/diff/40001/ash/accelerators/accelerator_controller.h File ash/accelerators/accelerator_controller.h (right): https://codereview.chromium.org/350943003/diff/40001/ash/accelerators/accelerator_controller.h#newcode42 ash/accelerators/accelerator_controller.h:42: // processing. On 2014/06/26 10:37:35, Finnur wrote: > I ...
6 years, 6 months ago (2014-06-27 00:49:11 UTC) #9
David Tseng
+ oshima for ash/... I think it's ready for an OWNER to look at.
6 years, 6 months ago (2014-06-27 00:54:11 UTC) #10
Finnur
Extensions stuff LGTM, with some questions and a couple of nits. I'll leave it to ...
6 years, 5 months ago (2014-06-27 11:10:57 UTC) #11
oshima
https://codereview.chromium.org/350943003/diff/80001/ash/accelerators/accelerator_controller.cc File ash/accelerators/accelerator_controller.cc (right): https://codereview.chromium.org/350943003/diff/80001/ash/accelerators/accelerator_controller.cc#newcode1120 ash/accelerators/accelerator_controller.cc:1120: const ui::Accelerator& accelerator) { accelerator is not used here. ...
6 years, 5 months ago (2014-06-27 18:40:41 UTC) #12
oshima
6 years, 5 months ago (2014-06-27 19:04:08 UTC) #13
David Tseng
First responding to oshima; thanks for the quick review. https://codereview.chromium.org/350943003/diff/80001/ash/accelerators/accelerator_controller.cc File ash/accelerators/accelerator_controller.cc (right): https://codereview.chromium.org/350943003/diff/80001/ash/accelerators/accelerator_controller.cc#newcode1120 ash/accelerators/accelerator_controller.cc:1120: ...
6 years, 5 months ago (2014-06-27 21:47:16 UTC) #14
Finnur
https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc File chrome/browser/extensions/global_shortcut_listener_chromeos.cc (right): https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc#newcode52 chrome/browser/extensions/global_shortcut_listener_chromeos.cc:52: return controller->IsRegistered(accelerator); > An extension trying to register would ...
6 years, 5 months ago (2014-06-27 22:23:44 UTC) #15
David Tseng
https://codereview.chromium.org/350943003/diff/40001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc File chrome/browser/extensions/global_shortcut_listener_chromeos.cc (right): https://codereview.chromium.org/350943003/diff/40001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc#newcode73 chrome/browser/extensions/global_shortcut_listener_chromeos.cc:73: RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; On 2014/06/27 11:10:57, Finnur wrote: > Let me ...
6 years, 5 months ago (2014-06-28 14:17:50 UTC) #16
Finnur
Still LGTM https://codereview.chromium.org/350943003/diff/40001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc File chrome/browser/extensions/global_shortcut_listener_chromeos.cc (right): https://codereview.chromium.org/350943003/diff/40001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc#newcode73 chrome/browser/extensions/global_shortcut_listener_chromeos.cc:73: RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; > Are we talking about in ...
6 years, 5 months ago (2014-06-30 10:39:45 UTC) #17
oshima
https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc File chrome/browser/extensions/global_shortcut_listener_chromeos.cc (right): https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc#newcode52 chrome/browser/extensions/global_shortcut_listener_chromeos.cc:52: return controller->IsRegistered(accelerator); On 2014/06/27 22:23:44, Finnur wrote: > > ...
6 years, 5 months ago (2014-07-01 17:48:25 UTC) #18
David Tseng
https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc File chrome/browser/extensions/global_shortcut_listener_chromeos.cc (right): https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc#newcode52 chrome/browser/extensions/global_shortcut_listener_chromeos.cc:52: return controller->IsRegistered(accelerator); On 2014/07/01 17:48:25, oshima wrote: > On ...
6 years, 5 months ago (2014-07-01 18:34:43 UTC) #19
David Tseng
https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc File chrome/browser/extensions/global_shortcut_listener_chromeos.cc (right): https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc#newcode52 chrome/browser/extensions/global_shortcut_listener_chromeos.cc:52: return controller->IsRegistered(accelerator); On 2014/07/01 17:48:25, oshima wrote: > On ...
6 years, 5 months ago (2014-07-01 20:20:35 UTC) #20
oshima
Thanks, CL looks good, with one more question below. https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc File chrome/browser/extensions/global_shortcut_listener_chromeos.cc (right): https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc#newcode52 chrome/browser/extensions/global_shortcut_listener_chromeos.cc:52: ...
6 years, 5 months ago (2014-07-02 00:51:36 UTC) #21
Finnur
https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc File chrome/browser/extensions/global_shortcut_listener_chromeos.cc (right): https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc#newcode52 chrome/browser/extensions/global_shortcut_listener_chromeos.cc:52: return controller->IsRegistered(accelerator); Not sure exactly what to disregard, so ...
6 years, 5 months ago (2014-07-02 12:41:25 UTC) #22
oshima
lgtm https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc File chrome/browser/extensions/global_shortcut_listener_chromeos.cc (right): https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/global_shortcut_listener_chromeos.cc#newcode52 chrome/browser/extensions/global_shortcut_listener_chromeos.cc:52: return controller->IsRegistered(accelerator); On 2014/07/02 12:41:25, Finnur wrote: > ...
6 years, 5 months ago (2014-07-02 23:01:13 UTC) #23
dtseng
https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/extension_commands_global_registry_apitest.cc File chrome/browser/extensions/extension_commands_global_registry_apitest.cc (right): https://codereview.chromium.org/350943003/diff/80001/chrome/browser/extensions/extension_commands_global_registry_apitest.cc#newcode124 chrome/browser/extensions/extension_commands_global_registry_apitest.cc:124: #if defined(OS_WIN) || defined(OS_CHROMEOS) On 2014/06/27 11:10:57, Finnur (OOO ...
6 years, 5 months ago (2014-07-07 18:17:19 UTC) #24
dtseng
The CQ bit was checked by dtseng@google.com
6 years, 5 months ago (2014-07-07 22:42:31 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtseng@chromium.org/350943003/160001
6 years, 5 months ago (2014-07-07 22:44:25 UTC) #26
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_aosp on tryserver.chromium ...
6 years, 5 months ago (2014-07-08 00:30:28 UTC) #27
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-08 01:04:13 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: android_aosp on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_aosp/builds/90391)
6 years, 5 months ago (2014-07-08 01:04:14 UTC) #29
David Tseng
The CQ bit was checked by dtseng@chromium.org
6 years, 5 months ago (2014-07-08 05:57:09 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtseng@chromium.org/350943003/160001
6 years, 5 months ago (2014-07-08 05:58:20 UTC) #31
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_chromeos_rel on tryserver.chromium ...
6 years, 5 months ago (2014-07-08 07:02:47 UTC) #32
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-08 08:16:02 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_chromium_chromeos_rel/builds/45283)
6 years, 5 months ago (2014-07-08 08:16:03 UTC) #34
Finnur
> This test works fine since it registers ctrl+shift+1. The other test, though, > times ...
6 years, 5 months ago (2014-07-08 10:00:51 UTC) #35
David Tseng
The CQ bit was checked by dtseng@chromium.org
6 years, 5 months ago (2014-07-08 17:52:18 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtseng@chromium.org/350943003/180001
6 years, 5 months ago (2014-07-08 17:53:18 UTC) #37
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_chromeos_rel on tryserver.chromium ...
6 years, 5 months ago (2014-07-08 21:56:47 UTC) #38
David Tseng
The CQ bit was unchecked by dtseng@chromium.org
6 years, 5 months ago (2014-07-08 22:40:17 UTC) #39
David Tseng
The CQ bit was checked by dtseng@chromium.org
6 years, 5 months ago (2014-07-08 22:49:03 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtseng@chromium.org/350943003/200001
6 years, 5 months ago (2014-07-08 22:53:52 UTC) #41
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_aosp on tryserver.chromium ...
6 years, 5 months ago (2014-07-09 00:11:16 UTC) #42
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-09 00:16:35 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: android_aosp on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_aosp/builds/90965) android_chromium_gn_compile_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_chromium_gn_compile_rel/builds/20678) android_clang_dbg ...
6 years, 5 months ago (2014-07-09 00:16:37 UTC) #44
David Tseng
The CQ bit was checked by dtseng@chromium.org
6 years, 5 months ago (2014-07-09 03:49:22 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtseng@chromium.org/350943003/220001
6 years, 5 months ago (2014-07-09 03:51:32 UTC) #46
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_chromeos_rel on tryserver.chromium ...
6 years, 5 months ago (2014-07-09 07:52:30 UTC) #47
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-09 08:58:59 UTC) #48
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_chromium_rel/builds/49729)
6 years, 5 months ago (2014-07-09 08:58:59 UTC) #49
David Tseng
The CQ bit was checked by dtseng@chromium.org
6 years, 5 months ago (2014-07-09 11:54:58 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtseng@chromium.org/350943003/240001
6 years, 5 months ago (2014-07-09 11:55:41 UTC) #51
commit-bot: I haz the power
6 years, 5 months ago (2014-07-09 20:29:38 UTC) #52
Message was sent while issue was closed.
Change committed as 282110

Powered by Google App Engine
This is Rietveld 408576698