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

Issue 9402018: Experimental Extension Keybinding (first cut). (Closed)

Created:
8 years, 10 months ago by Finnur
Modified:
8 years, 10 months ago
Reviewers:
sadrul, Matt Perry, sky
CC:
chromium-reviews, Aaron Boodman, ben+watch_chromium.org, mihaip+watch_chromium.org, dcheng, tfarina
Visibility:
Public.

Description

Experimental Extension Keybinding (first cut). Implemented in this cut: - End-to-end extension keybinding -- in one dimension, that is -- no UI, just basic functionality, such as: - Manifest changes to specify keybinding. - A simple parser to parse the keybinding from the manifest. - An Extension Keybinding Registry object. - The ability to open browser action popups, page action popups and send named events to the Extension. Not implemented: - All non-Windows specific code. - Install-success-bubble UI changes (that notify the user of new keybinding -- or of keybinding conflict) - A UI to show all keybindings and keybinding conflicts, allowing user to reconfigure keybindings. BUG=27702 TEST=This is tested by an automated test and requires an extension to test manually (one that registers keybinding shortcuts). Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=123228

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : #

Total comments: 20

Patch Set 13 : #

Patch Set 14 : Comments addressed #

Total comments: 3

Patch Set 15 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+914 lines, -59 lines) Patch
M ash/accelerators/accelerator_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -2 lines 0 comments Download
M ash/focus_cycler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_browser_event_router.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_browser_event_router.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +15 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_keybinding_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +81 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_keybinding_registry.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +72 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_keybinding_registry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +113 lines, -0 lines 0 comments Download
M chrome/browser/external_tab_container_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/browser_actions_container.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +13 lines, -1 line 0 comments Download
M chrome/browser/ui/views/browser_actions_container.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +26 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/dropdown_bar_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/find_bar_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/location_bar/page_action_image_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/ui/views/location_bar/page_action_image_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +32 lines, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/common_resources.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/extensions/api/experimental.keybinding.json View 1 chunk +19 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/extension_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/extension.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +32 lines, -2 lines 0 comments Download
M chrome/common/extensions/extension.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 10 chunks +134 lines, -6 lines 0 comments Download
M chrome/common/extensions/extension_constants.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +9 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_constants.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +13 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_permission_set.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/extension_permission_set.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_permission_set_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +84 lines, -0 lines 0 comments Download
M chrome/common/extensions/manifest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M ui/base/accelerators/accelerator_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +24 lines, -2 lines 0 comments Download
M ui/base/accelerators/accelerator_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +46 lines, -7 lines 0 comments Download
M ui/views/accessible_pane_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -6 lines 0 comments Download
M ui/views/focus/focus_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +13 lines, -0 lines 0 comments Download
M ui/views/focus/focus_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +15 lines, -8 lines 0 comments Download
M ui/views/focus/focus_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +112 lines, -9 lines 0 comments Download
M ui/views/view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 10 (0 generated)
Finnur
I need to find someone to bless the Accelerator changes, but this is ready for ...
8 years, 10 months ago (2012-02-16 18:21:57 UTC) #1
Finnur
Yutak: Jay, who wrote the FocusManager, is on another project now. Can you fill in ...
8 years, 10 months ago (2012-02-20 10:55:37 UTC) #2
Yuta Kitamura
I'm probably not the best person to review this change because I haven't touched any ...
8 years, 10 months ago (2012-02-20 13:41:12 UTC) #3
Finnur
Sadrul, can you take over for Yuta?
8 years, 10 months ago (2012-02-20 15:05:39 UTC) #4
sadrul
LGTM for changes in ui/views/. I also looked at the changes in ash/ and some ...
8 years, 10 months ago (2012-02-21 16:17:28 UTC) #5
Finnur
mpcomplete: ping sadrul: Thanks for reviewing, comments below. sky: can you give OWNERS LGTM for ...
8 years, 10 months ago (2012-02-21 21:58:21 UTC) #6
Matt Perry
http://codereview.chromium.org/9402018/diff/24001/chrome/browser/extensions/extension_browser_event_router.cc File chrome/browser/extensions/extension_browser_event_router.cc (right): http://codereview.chromium.org/9402018/diff/24001/chrome/browser/extensions/extension_browser_event_router.cc#newcode667 chrome/browser/extensions/extension_browser_event_router.cc:667: extension_id, nit: indent +2 http://codereview.chromium.org/9402018/diff/24001/chrome/browser/extensions/extension_keybinding_registry.cc File chrome/browser/extensions/extension_keybinding_registry.cc (right): http://codereview.chromium.org/9402018/diff/24001/chrome/browser/extensions/extension_keybinding_registry.cc#newcode86 ...
8 years, 10 months ago (2012-02-21 23:13:39 UTC) #7
sky
LGTM, but I think you should convert to enum. http://codereview.chromium.org/9402018/diff/24001/ui/base/accelerators/accelerator_manager.h File ui/base/accelerators/accelerator_manager.h (right): http://codereview.chromium.org/9402018/diff/24001/ui/base/accelerators/accelerator_manager.h#newcode34 ui/base/accelerators/accelerator_manager.h:34: ...
8 years, 10 months ago (2012-02-22 18:02:52 UTC) #8
Finnur
Changed to an enum and added a test to to extension_unittest.cc. Also addressed other comments ...
8 years, 10 months ago (2012-02-22 23:45:21 UTC) #9
Matt Perry
8 years, 10 months ago (2012-02-22 23:59:42 UTC) #10
lgtm

http://codereview.chromium.org/9402018/diff/11135/chrome/common/extensions/ex...
File chrome/common/extensions/extension.cc (right):

http://codereview.chromium.org/9402018/diff/11135/chrome/common/extensions/ex...
chrome/common/extensions/extension.cc:273: base::ToUpperASCII(tokens[i][0]) >=
ui::VKEY_A &&
Just use 'a' so you don't have to uppercase it. Also, you're actually looking at
a character rather than a KeyboardCode, so it's safer to compare to the ASCII
val in case the KeyboardCode isn't the same.

http://codereview.chromium.org/9402018/diff/11135/chrome/common/extensions/ex...
chrome/common/extensions/extension.cc:282: ui::VKEY_A +
(base::ToUpperASCII(tokens[i][0]) - ui::VKEY_A));
see above, second VKEY_A => 'a'

http://codereview.chromium.org/9402018/diff/11135/chrome/common/extensions/ex...
chrome/common/extensions/extension.cc:295: if (key == ui::VKEY_UNKNOWN || ctrl
== true && alt == true) {
Please add parens around (ctrl == true && alt == true) since it's always
confusing what has higher precedence.

Also, just test (ctrl && alt) since they're bools.

Powered by Google App Engine
This is Rietveld 408576698