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

Issue 504183004: Continue key propagation for extensions without any listeners to chrome.commands.onCommand. (Closed)

Created:
6 years, 3 months ago by David Tseng
Modified:
6 years, 3 months ago
Reviewers:
Finnur
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, dmazzoni, Peter Lundblad
Base URL:
https://chromium.googlesource.com/chromium/src.git@lkcr
Project:
chromium
Visibility:
Public.

Description

Allow key events to continue propagation for commands without any event listeners. Rather than complicating the API with proposals of key re injection, or runtime registration/deregistration (which we might want for other reasons in the future), here's a very simple change that would probably give us the same functionality. If an extension remove all chrome.commands.onCommand listeners, then they will no longer receive the onCommand event and thereafter, the browser should continue propagating the key event and not drop it. I think this is actually the correct behavior, but also allows extension authors to have a little more control over when a command should be processed. BUG=407163 Committed: https://crrev.com/fa5d9da251c9aa5333ab5a22ddd0bb51f44d1db2 Cr-Commit-Position: refs/heads/master@{#292997}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fix tests. #

Patch Set 3 : Add new test. #

Total comments: 14

Patch Set 4 : Address feedback. #

Total comments: 4

Patch Set 5 : Address nits #

Patch Set 6 : Change manifest to use MacCtrl. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -1 line) Patch
M chrome/browser/extensions/extension_keybinding_apitest.cc View 1 2 3 4 1 chunk +30 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_keybinding_registry.cc View 1 2 3 3 chunks +10 lines, -1 line 0 comments Download
A chrome/test/data/extensions/api_test/keybinding/continue_propagation/background.js View 1 2 3 1 chunk +32 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/keybinding/continue_propagation/injected.js View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/keybinding/continue_propagation/manifest.json View 1 2 3 4 5 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (3 generated)
David Tseng
dtseng@chromium.org changed reviewers: + finnur@chromium.org
6 years, 3 months ago (2014-08-26 19:33:16 UTC) #1
David Tseng
Publishing since it's a relatively trivial change. Rather than complicating the API with proposals of ...
6 years, 3 months ago (2014-08-26 19:33:16 UTC) #2
Finnur
https://codereview.chromium.org/504183004/diff/1/chrome/browser/extensions/extension_keybinding_registry.cc File chrome/browser/extensions/extension_keybinding_registry.cc (right): https://codereview.chromium.org/504183004/diff/1/chrome/browser/extensions/extension_keybinding_registry.cc#newcode237 chrome/browser/extensions/extension_keybinding_registry.cc:237: if (!extensions::EventRouter::Get(browser_context_) Be careful here: extension_id can be empty ...
6 years, 3 months ago (2014-08-27 11:28:31 UTC) #3
David Tseng
W.I.P. On Wed, Aug 27, 2014 at 4:28 AM, <finnur@chromium.org> wrote: > > https://codereview.chromium.org/504183004/diff/1/chrome/ > ...
6 years, 3 months ago (2014-08-27 14:13:30 UTC) #4
Finnur
> > Sorry, I wanted to sanity check the approach before proceeding; will mark > ...
6 years, 3 months ago (2014-08-27 15:48:03 UTC) #5
David Tseng
w.i.p. https://codereview.chromium.org/504183004/diff/1/chrome/browser/extensions/extension_keybinding_registry.cc File chrome/browser/extensions/extension_keybinding_registry.cc (right): https://codereview.chromium.org/504183004/diff/1/chrome/browser/extensions/extension_keybinding_registry.cc#newcode237 chrome/browser/extensions/extension_keybinding_registry.cc:237: if (!extensions::EventRouter::Get(browser_context_) On 2014/08/27 11:28:31, Finnur wrote: > ...
6 years, 3 months ago (2014-08-27 16:34:22 UTC) #6
David Tseng
Ready for review. Includes a CommandsApiTest. I'm not sure it adds any value to add ...
6 years, 3 months ago (2014-08-27 21:10:47 UTC) #7
David Tseng
Patchset #4 (id:60001) has been deleted
6 years, 3 months ago (2014-08-27 22:09:44 UTC) #8
David Tseng
Patchset #3 (id:40001) has been deleted
6 years, 3 months ago (2014-08-27 22:09:55 UTC) #9
Finnur
Your new test seems to have failed on Mac... > I'm not sure it adds ...
6 years, 3 months ago (2014-08-28 11:15:39 UTC) #10
David Tseng
Not sure why the test fails on Mac, but hoping bringing the browser window to ...
6 years, 3 months ago (2014-08-28 23:37:11 UTC) #11
Finnur
Looks like the test is still failing, but the good news is that it fails ...
6 years, 3 months ago (2014-08-29 12:17:01 UTC) #12
David Tseng
Answering questions; still looking at the try failure. https://codereview.chromium.org/504183004/diff/80001/chrome/browser/extensions/extension_keybinding_registry.cc File chrome/browser/extensions/extension_keybinding_registry.cc (right): https://codereview.chromium.org/504183004/diff/80001/chrome/browser/extensions/extension_keybinding_registry.cc#newcode21 chrome/browser/extensions/extension_keybinding_registry.cc:21: const ...
6 years, 3 months ago (2014-08-29 17:18:46 UTC) #13
Finnur
LGTM, once the test failure has been figured out.
6 years, 3 months ago (2014-09-01 10:46:10 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtseng@chromium.org/504183004/280001
6 years, 3 months ago (2014-09-02 17:56:48 UTC) #18
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: mac_chromium_rel_swarming on tryserver.chromium.mac ...
6 years, 3 months ago (2014-09-02 19:46:42 UTC) #19
commit-bot: I haz the power
Committed patchset #6 (id:280001) as 0cc73280f29c2745c8b571d8df0dc110a933cb22
6 years, 3 months ago (2014-09-02 21:09:25 UTC) #20
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 03:20:45 UTC) #21
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/fa5d9da251c9aa5333ab5a22ddd0bb51f44d1db2
Cr-Commit-Position: refs/heads/master@{#292997}

Powered by Google App Engine
This is Rietveld 408576698