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

Issue 360423002: Allow WebContents key handling to supplant extension overrides of the bookmark shortcut (Closed)

Created:
6 years, 5 months ago by Mike Wittman
Modified:
6 years, 5 months ago
Reviewers:
Finnur, Peter Kasting
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, tfarina, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@lkgr
Project:
chromium
Visibility:
Public.

Description

Allow WebContents key handling to supplant extension overrides of the bookmark shortcut Use the same prioritization for accelerator processing for the bookmark shortcut when overridden by an extension as for when it is built-in to the browser. Namely, allow WebContents key processing to take place before extension accelerator processing. Two changes are required: 1. Register the keybinding with normal priority rather than high priority, so that FocusManager::OnKeyEvent does not process the accelerator before the WebContents. 2. Don't process the accelerator for the extension in the AcceleratorTarget subclasses. Instead, use the existing browser command processing in BookmarkCurrentPage which delegates to the extension. This is necessary so that the extension accelerator processing does not get invoked while command execution is otherwise blocked in BrowserView::PreHandleKeyboardEvent. This change is for Views. Mac will be addressed in a separate CL. BUG=389340 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=281946

Patch Set 1 #

Patch Set 2 : update test #

Total comments: 13

Patch Set 3 : address comments #

Total comments: 8

Patch Set 4 : address comments #

Total comments: 12

Patch Set 5 : address comments #

Patch Set 6 : add comment #

Patch Set 7 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+247 lines, -13 lines) Patch
M chrome/browser/extensions/extension_keybinding_apitest.cc View 1 2 3 1 chunk +108 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_keybinding_registry.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
A chrome/browser/ui/extensions/accelerator_priority.h View 1 2 3 4 5 1 chunk +47 lines, -0 lines 0 comments Download
A chrome/browser/ui/extensions/accelerator_priority.cc View 1 2 3 1 chunk +35 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc View 1 2 3 4 3 chunks +14 lines, -9 lines 0 comments Download
M chrome/browser/ui/views/location_bar/page_action_image_view.cc View 1 2 3 4 3 chunks +10 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/toolbar/browser_action_view.cc View 1 2 3 4 5 6 3 chunks +11 lines, -1 line 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/test_file_with_ctrl-d_keybinding.html View 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Mike Wittman
Finnur, please take a look.
6 years, 5 months ago (2014-07-01 22:30:43 UTC) #1
Finnur
https://codereview.chromium.org/360423002/diff/20001/chrome/browser/extensions/extension_keybinding_registry.h File chrome/browser/extensions/extension_keybinding_registry.h (right): https://codereview.chromium.org/360423002/diff/20001/chrome/browser/extensions/extension_keybinding_registry.h#newcode124 chrome/browser/extensions/extension_keybinding_registry.h:124: content::BrowserContext* browser_context() const { return browser_context_; } nit: doc. ...
6 years, 5 months ago (2014-07-02 11:56:16 UTC) #2
Mike Wittman
https://codereview.chromium.org/360423002/diff/20001/chrome/browser/extensions/extension_keybinding_registry.h File chrome/browser/extensions/extension_keybinding_registry.h (right): https://codereview.chromium.org/360423002/diff/20001/chrome/browser/extensions/extension_keybinding_registry.h#newcode124 chrome/browser/extensions/extension_keybinding_registry.h:124: content::BrowserContext* browser_context() const { return browser_context_; } On 2014/07/02 ...
6 years, 5 months ago (2014-07-02 21:56:20 UTC) #3
Finnur
LGTM (with nits), as long as I'm understanding things correctly (see question below). https://codereview.chromium.org/360423002/diff/20001/chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc File ...
6 years, 5 months ago (2014-07-03 11:09:59 UTC) #4
Mike Wittman
https://codereview.chromium.org/360423002/diff/60001/chrome/browser/extensions/extension_keybinding_apitest.cc File chrome/browser/extensions/extension_keybinding_apitest.cc (right): https://codereview.chromium.org/360423002/diff/60001/chrome/browser/extensions/extension_keybinding_apitest.cc#newcode351 chrome/browser/extensions/extension_keybinding_apitest.cc:351: ASSERT_TRUE(RunExtensionTest("keybinding/basics")) On 2014/07/03 11:09:59, Finnur (OOO - back Jul ...
6 years, 5 months ago (2014-07-07 18:43:58 UTC) #5
Mike Wittman
Peter, can you do OWNERS review of c/b/ui?
6 years, 5 months ago (2014-07-07 18:45:13 UTC) #6
Peter Kasting
https://codereview.chromium.org/360423002/diff/80001/chrome/browser/ui/extensions/accelerator_priority.cc File chrome/browser/ui/extensions/accelerator_priority.cc (right): https://codereview.chromium.org/360423002/diff/80001/chrome/browser/ui/extensions/accelerator_priority.cc#newcode24 chrome/browser/ui/extensions/accelerator_priority.cc:24: return ui::AcceleratorManager::kHighPriority; It seems surprising to me that IDC_BOOKMARK_PAGE ...
6 years, 5 months ago (2014-07-07 23:47:11 UTC) #7
Finnur
https://codereview.chromium.org/360423002/diff/80001/chrome/browser/ui/extensions/accelerator_priority.cc File chrome/browser/ui/extensions/accelerator_priority.cc (right): https://codereview.chromium.org/360423002/diff/80001/chrome/browser/ui/extensions/accelerator_priority.cc#newcode24 chrome/browser/ui/extensions/accelerator_priority.cc:24: return ui::AcceleratorManager::kHighPriority; The intent here is to allow extensions ...
6 years, 5 months ago (2014-07-08 10:35:03 UTC) #8
Mike Wittman
https://codereview.chromium.org/360423002/diff/80001/chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc File chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc (right): https://codereview.chromium.org/360423002/diff/80001/chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc#newcode57 chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc:57: if (!IsAcceleratorRegistered(iter->second.accelerator())) { On 2014/07/07 23:47:10, Peter Kasting wrote: ...
6 years, 5 months ago (2014-07-08 19:29:01 UTC) #9
Peter Kasting
LGTM https://codereview.chromium.org/360423002/diff/80001/chrome/browser/ui/extensions/accelerator_priority.cc File chrome/browser/ui/extensions/accelerator_priority.cc (right): https://codereview.chromium.org/360423002/diff/80001/chrome/browser/ui/extensions/accelerator_priority.cc#newcode24 chrome/browser/ui/extensions/accelerator_priority.cc:24: return ui::AcceleratorManager::kHighPriority; On 2014/07/08 10:35:02, Finnur (OOO - ...
6 years, 5 months ago (2014-07-08 19:30:36 UTC) #10
Mike Wittman
https://codereview.chromium.org/360423002/diff/80001/chrome/browser/ui/extensions/accelerator_priority.cc File chrome/browser/ui/extensions/accelerator_priority.cc (right): https://codereview.chromium.org/360423002/diff/80001/chrome/browser/ui/extensions/accelerator_priority.cc#newcode24 chrome/browser/ui/extensions/accelerator_priority.cc:24: return ui::AcceleratorManager::kHighPriority; On 2014/07/08 19:30:36, Peter Kasting wrote: > ...
6 years, 5 months ago (2014-07-08 22:15:21 UTC) #11
Mike Wittman
The CQ bit was checked by wittman@chromium.org
6 years, 5 months ago (2014-07-08 22:15:38 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wittman@chromium.org/360423002/140001
6 years, 5 months ago (2014-07-08 22:17:50 UTC) #13
Mike Wittman
The CQ bit was checked by wittman@chromium.org
6 years, 5 months ago (2014-07-08 22:30:21 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wittman@chromium.org/360423002/160001
6 years, 5 months ago (2014-07-08 22:31:33 UTC) #15
commit-bot: I haz the power
6 years, 5 months ago (2014-07-09 05:13:27 UTC) #16
Message was sent while issue was closed.
Change committed as 281946

Powered by Google App Engine
This is Rietveld 408576698