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

Issue 788973002: Observe OnExtensionLoaded to trigger update of chrome.commands keybindings for component extensions. (Closed)

Created:
6 years ago by David Tseng
Modified:
5 years, 11 months ago
Reviewers:
Finnur
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, dmazzoni, Peter Lundblad, asargent_no_longer_on_chrome
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Observe OnExtensionLoaded to trigger update of chrome.commands keybindings for component extensions. ExtensionRegistryObserver::OnExtensionWillBeInstalled only triggers when a component extension loads for the first time on a new profile. As a result, component extensions using the commands api never get their commands manifest block re-parsed on an update. The fix is to observe load to trigger update of keybindings which differs from what happens in ExtensionKyebindingRegistry's OnExtensionLoaded; namely, the kExtensionBindings pref gets set in the former only. BUG=440459 TEST=manually edit a component extension's manifest command keybinding. Load the component extension and observe the keybinding changes and triggers on the new keybinding. Committed: https://crrev.com/7c3129ac745bd5598bde8ce572444f9a7224e4ce Cr-Commit-Position: refs/heads/master@{#311320}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Condition on Manifest::COMPONENT. #

Total comments: 7

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : Last dnr hopefully #

Patch Set 6 : dnr #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : Update comment. #

Total comments: 3

Patch Set 10 : Condition on OnExtensionLoaded in ExtensionKeybindingRegistry #

Patch Set 11 : Relocate condition. #

Patch Set 12 : #

Total comments: 6

Patch Set 13 : Address comments. #

Patch Set 14 : Rebase #

Patch Set 15 : Fix compile #

Patch Set 16 : Based on master #

Patch Set 17 : Rebased onto master #

Patch Set 18 : Fix compile #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -3 lines) Patch
M chrome/browser/extensions/api/commands/command_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/commands/command_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_keybinding_registry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +9 lines, -2 lines 0 comments Download

Messages

Total messages: 67 (35 generated)
David Tseng
6 years ago (2014-12-09 21:41:09 UTC) #2
David Tseng
On 2014/12/09 21:41:09, David Tseng wrote: FYI. This appears to be W.I.P. since the tests ...
6 years ago (2014-12-10 00:45:32 UTC) #3
Finnur
https://codereview.chromium.org/788973002/diff/1/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/788973002/diff/1/chrome/browser/extensions/api/commands/command_service.cc#newcode306 chrome/browser/extensions/api/commands/command_service.cc:306: RemoveKeybindingPrefs(extension->id(), std::string()); If I temporarily disable an extension/it crashes, ...
6 years ago (2014-12-10 12:25:38 UTC) #4
David Tseng
https://codereview.chromium.org/788973002/diff/1/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/788973002/diff/1/chrome/browser/extensions/api/commands/command_service.cc#newcode306 chrome/browser/extensions/api/commands/command_service.cc:306: RemoveKeybindingPrefs(extension->id(), std::string()); On 2014/12/10 12:25:38, Finnur wrote: > If ...
6 years ago (2014-12-10 17:27:51 UTC) #6
Finnur
https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc#newcode303 chrome/browser/extensions/api/commands/command_service.cc:303: if (extension->location() != Manifest::COMPONENT) I would document this with: ...
6 years ago (2014-12-11 13:51:49 UTC) #7
asargent_no_longer_on_chrome
Huh, I took a brief look and didn't see any code around triggering the OnExtensionWillBeInstalled ...
6 years ago (2014-12-11 22:14:43 UTC) #13
David Tseng
On 2014/12/11 22:14:43, asargent wrote: > Huh, I took a brief look and didn't see ...
6 years ago (2014-12-12 18:09:01 UTC) #14
David Tseng
https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc#newcode303 chrome/browser/extensions/api/commands/command_service.cc:303: if (extension->location() != Manifest::COMPONENT) On 2014/12/11 13:51:49, Finnur wrote: ...
6 years ago (2014-12-12 18:38:31 UTC) #15
Finnur
https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc#newcode303 chrome/browser/extensions/api/commands/command_service.cc:303: if (extension->location() != Manifest::COMPONENT) OK, in that case I'd ...
6 years ago (2014-12-15 14:01:43 UTC) #16
David Tseng
On 2014/12/15 14:01:43, Finnur wrote: > https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc > File chrome/browser/extensions/api/commands/command_service.cc (right): > > https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc#newcode303 > ...
6 years ago (2014-12-15 16:27:58 UTC) #17
David Tseng
PTAL; got all tests to pass.
6 years ago (2014-12-18 01:06:10 UTC) #28
Finnur
https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc#newcode303 chrome/browser/extensions/api/commands/command_service.cc:303: if (extension->location() != Manifest::COMPONENT) On 2014/12/15 14:01:42, Finnur wrote: ...
6 years ago (2014-12-19 15:26:52 UTC) #29
David Tseng
https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/788973002/diff/40001/chrome/browser/extensions/api/commands/command_service.cc#newcode303 chrome/browser/extensions/api/commands/command_service.cc:303: if (extension->location() != Manifest::COMPONENT) On 2014/12/15 14:01:42, Finnur wrote: ...
6 years ago (2014-12-19 19:41:01 UTC) #30
Finnur
https://codereview.chromium.org/788973002/diff/380001/chrome/browser/extensions/extension_keybinding_registry.cc File chrome/browser/extensions/extension_keybinding_registry.cc (right): https://codereview.chromium.org/788973002/diff/380001/chrome/browser/extensions/extension_keybinding_registry.cc#newcode146 chrome/browser/extensions/extension_keybinding_registry.cc:146: return; My recommendation would be to revert back to ...
6 years ago (2014-12-22 15:20:08 UTC) #31
David Tseng
PTAL On 2014/12/22 15:20:08, Finnur wrote: > https://codereview.chromium.org/788973002/diff/380001/chrome/browser/extensions/extension_keybinding_registry.cc > File chrome/browser/extensions/extension_keybinding_registry.cc (right): > > https://codereview.chromium.org/788973002/diff/380001/chrome/browser/extensions/extension_keybinding_registry.cc#newcode146 ...
5 years, 11 months ago (2015-01-07 22:49:42 UTC) #43
Finnur
https://codereview.chromium.org/788973002/diff/650001/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/788973002/diff/650001/chrome/browser/extensions/api/commands/command_service.cc#newcode304 chrome/browser/extensions/api/commands/command_service.cc:304: // those are handled in loaded. s/in loaded/in OnExtensionLoaded/ ...
5 years, 11 months ago (2015-01-08 14:13:50 UTC) #44
David Tseng
https://codereview.chromium.org/788973002/diff/650001/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/788973002/diff/650001/chrome/browser/extensions/api/commands/command_service.cc#newcode304 chrome/browser/extensions/api/commands/command_service.cc:304: // those are handled in loaded. On 2015/01/08 14:13:50, ...
5 years, 11 months ago (2015-01-08 20:34:41 UTC) #45
Finnur
I see. LGTM
5 years, 11 months ago (2015-01-12 10:09:38 UTC) #46
Finnur
Actually, shouldn't we have a test that exercises this use case?
5 years, 11 months ago (2015-01-12 10:10:30 UTC) #47
David Tseng
I wasn't able to reproduce the issue using a pair of extensions, each having the ...
5 years, 11 months ago (2015-01-13 00:43:41 UTC) #48
David Tseng
Actually, I see the discrepancy. ChromeVox uses ComponentLoader::Remove to unload the extension; ExtensionBrowserTest uses ExtensionService::UnloadExtension ...
5 years, 11 months ago (2015-01-13 00:57:17 UTC) #49
Finnur
Does that mean you are looking into it still or wanting to check in and ...
5 years, 11 months ago (2015-01-13 11:18:16 UTC) #50
David Tseng
On Tue, Jan 13, 2015 at 3:18 AM, <finnur@chromium.org> wrote: > Does that mean you ...
5 years, 11 months ago (2015-01-13 18:38:27 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/788973002/710001
5 years, 11 months ago (2015-01-13 18:40:44 UTC) #53
commit-bot: I haz the power
CLs for remote refs other than refs/pending/heads/master must contain NOTRY=true in order for the CQ ...
5 years, 11 months ago (2015-01-13 18:40:49 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/788973002/730001
5 years, 11 months ago (2015-01-13 18:55:44 UTC) #57
commit-bot: I haz the power
Try jobs failed on following builders: android_aosp on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_aosp/builds/48316) android_arm64_dbg_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_arm64_dbg_recipe/builds/36949) android_chromium_gn_compile_dbg ...
5 years, 11 months ago (2015-01-13 18:59:45 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/788973002/750001
5 years, 11 months ago (2015-01-13 19:10:01 UTC) #61
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_rel/builds/49432)
5 years, 11 months ago (2015-01-13 19:21:18 UTC) #63
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/788973002/770001
5 years, 11 months ago (2015-01-13 19:30:31 UTC) #65
commit-bot: I haz the power
Committed patchset #18 (id:770001)
5 years, 11 months ago (2015-01-13 20:49:57 UTC) #66
commit-bot: I haz the power
5 years, 11 months ago (2015-01-13 20:50:53 UTC) #67
Message was sent while issue was closed.
Patchset 18 (id:??) landed as
https://crrev.com/7c3129ac745bd5598bde8ce572444f9a7224e4ce
Cr-Commit-Position: refs/heads/master@{#311320}

Powered by Google App Engine
This is Rietveld 408576698