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

Issue 904943003: Fixes component extension commands assignment on reload. (Closed)

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

Description

Fixes component extension commands assignment on reload. Component extensions, when added/removed, trigger the following calls to ExtensionRegistryObserver: Add: OnExtensionWillBeInstalled OnExtensionInstalled OnExtensionLoaded Remove: OnExtensionUnloaded OnExtensionUninstalled Add (2nd call) OnExtensionLoaded Removed (2nd call): OnExtensionUnloaded OnExtensionUninstalled In the non-component case, the 2nd calls are identical to the 1st. To work around this issue but still support whatever observers depend on this behavior, an uninstall reason component has been added and checked for explicitly in CommandService::OnExtensionUninstalled. This has the positive side effect of removing the special casing in OnExtensionWillBeInstalled for component extensions in CommandService. BUG=457350, 458612 TEST=interactive_ui_tests --gtest_filter=CommandsApiTest.AddRemoveAddComponentExtension Committed: https://crrev.com/9fb3d5b62a6466053aeee3a26c0d0a898428f4eb Cr-Commit-Position: refs/heads/master@{#317602}

Patch Set 1 #

Patch Set 2 : git cl format #

Patch Set 3 : Fix test #

Patch Set 4 : Added test. #

Patch Set 5 : Much cleaner fix. #

Patch Set 6 : Fix Mac. #

Patch Set 7 : Move clearing to OnExtensionUninstalled #

Total comments: 5

Patch Set 8 : New approach. #

Patch Set 9 : #

Patch Set 10 : #

Total comments: 17

Patch Set 11 : Address feedback. #

Total comments: 6

Patch Set 12 : Address kalman's comments. #

Patch Set 13 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -15 lines) Patch
M chrome/browser/extensions/api/commands/command_service.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -2 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 1 chunk +9 lines, -10 lines 0 comments Download
M chrome/browser/extensions/extension_keybinding_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +16 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_service.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -2 lines 0 comments Download
A chrome/test/data/extensions/api_test/keybinding/component/background.js View 1 2 3 4 5 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/keybinding/component/manifest.json View 1 2 3 1 chunk +17 lines, -0 lines 0 comments Download
M extensions/browser/uninstall_reason.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 50 (8 generated)
David Tseng
5 years, 10 months ago (2015-02-06 18:27:16 UTC) #2
Finnur
Mike should probably be involved, since this both augments the changes he made and the ...
5 years, 10 months ago (2015-02-09 09:37:59 UTC) #4
Mike Wittman
It's not clear to me what the behavior at issue is here. Can you please ...
5 years, 10 months ago (2015-02-10 19:30:58 UTC) #5
David Tseng
Here's a bug: crbug.com/457350 <https://code.google.com/p/chromium/issues/detail?id=457350> I'll try to write a test that demonstrates the issue. ...
5 years, 10 months ago (2015-02-10 19:43:11 UTC) #6
David Tseng
I went ahead and also added a test (extension_keybinding_apitest.cc). On Tue, Feb 10, 2015 at ...
5 years, 10 months ago (2015-02-10 21:36:48 UTC) #7
Mike Wittman
On 2015/02/10 21:36:48, David Tseng wrote: > I went ahead and also added a test ...
5 years, 10 months ago (2015-02-10 22:44:48 UTC) #8
David Tseng
PTAL at the newest patchset which does what you're saying. The issue is that component ...
5 years, 10 months ago (2015-02-10 23:06:45 UTC) #9
David Tseng
Friendly ping. On 2015/02/10 23:06:45, David Tseng wrote: > PTAL at the newest patchset which ...
5 years, 10 months ago (2015-02-12 16:21:34 UTC) #10
Mike Wittman
On 2015/02/12 16:21:34, David Tseng wrote: > Friendly ping. > > On 2015/02/10 23:06:45, David ...
5 years, 10 months ago (2015-02-12 20:02:43 UTC) #11
David Tseng
On Thu, Feb 12, 2015 at 12:02 PM, <wittman@chromium.org> wrote: On 2015/02/12 16:21:34, David Tseng ...
5 years, 10 months ago (2015-02-12 20:27:39 UTC) #12
David Tseng
On Thu, Feb 12, 2015 at 12:27 PM, David Tseng <dtseng@chromium.org> wrote: > > > ...
5 years, 10 months ago (2015-02-12 21:30:57 UTC) #13
Mike Wittman
On 2015/02/12 21:30:57, David Tseng wrote: > On Thu, Feb 12, 2015 at 12:27 PM, ...
5 years, 10 months ago (2015-02-13 00:15:16 UTC) #14
David Tseng
Maybe I'm missing something here, but removing a component extension didn't cause OnExtensionUninstalled to get ...
5 years, 10 months ago (2015-02-13 01:19:35 UTC) #15
David Tseng
On Thu, Feb 12, 2015 at 5:19 PM, David Tseng <dtseng@chromium.org> wrote: > Maybe I'm ...
5 years, 10 months ago (2015-02-13 01:21:18 UTC) #16
Finnur
> Can we determine when a component extension has been updated and do > OnExtensionInstalled ...
5 years, 10 months ago (2015-02-13 15:06:35 UTC) #17
David Tseng
PTAL. After moving clearing of the pref was_assigned, CommandsApiTest.Component still passes. Here's what I got ...
5 years, 10 months ago (2015-02-13 18:30:28 UTC) #18
David Tseng
+ kalman. Are you aware of this issue with component extension add/removed not triggering OnExtensionWillBeInstalled ...
5 years, 10 months ago (2015-02-13 18:36:25 UTC) #20
not at google - send to devlin
On 2015/02/13 18:36:25, David Tseng wrote: > + kalman. Are you aware of this issue ...
5 years, 10 months ago (2015-02-13 18:51:26 UTC) #21
not at google - send to devlin
it = not firing the event.
5 years, 10 months ago (2015-02-13 18:51:34 UTC) #22
David Tseng
On 2015/02/13 18:51:26, kalman wrote: > On 2015/02/13 18:36:25, David Tseng wrote: > > + ...
5 years, 10 months ago (2015-02-13 19:06:28 UTC) #23
Mike Wittman
https://codereview.chromium.org/904943003/diff/120001/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/904943003/diff/120001/chrome/browser/extensions/api/commands/command_service.cc#newcode808 chrome/browser/extensions/api/commands/command_service.cc:808: std::string command; indentation (+ next three lines) https://codereview.chromium.org/904943003/diff/120001/chrome/browser/extensions/api/commands/command_service.cc#newcode820 chrome/browser/extensions/api/commands/command_service.cc:820: ...
5 years, 10 months ago (2015-02-13 22:11:21 UTC) #24
David Tseng
Looking at this a little more this morning and ExtensionService::RemoveComponentExtension triggers ExtensionRegistryObserver::OnExtensionUninstalled while the install ...
5 years, 10 months ago (2015-02-17 18:42:37 UTC) #25
Mike Wittman
On 2015/02/17 18:42:37, David Tseng wrote: > Looking at this a little more this morning ...
5 years, 10 months ago (2015-02-17 19:17:36 UTC) #26
David Tseng
Sounds good; thanks for helping out. On Tue, Feb 17, 2015 at 11:17 AM, <wittman@chromium.org> ...
5 years, 10 months ago (2015-02-17 19:18:14 UTC) #27
Finnur
https://codereview.chromium.org/904943003/diff/180001/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (left): https://codereview.chromium.org/904943003/diff/180001/chrome/browser/extensions/api/commands/command_service.cc#oldcode313 chrome/browser/extensions/api/commands/command_service.cc:313: if (extension->location() != Manifest::COMPONENT) It is good to see ...
5 years, 10 months ago (2015-02-18 11:51:31 UTC) #28
David Tseng
+ tapted. Please see bug crbug.com/458612 and your change (3 years ago) to ExtensionService::AddComponentExtension for ...
5 years, 10 months ago (2015-02-18 18:24:41 UTC) #30
tapted
https://codereview.chromium.org/904943003/diff/180001/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/904943003/diff/180001/chrome/browser/extensions/api/commands/command_service.cc#newcode319 chrome/browser/extensions/api/commands/command_service.cc:319: return; On 2015/02/18 18:24:40, David Tseng wrote: > On ...
5 years, 10 months ago (2015-02-18 23:10:55 UTC) #31
David Tseng
https://codereview.chromium.org/904943003/diff/180001/chrome/browser/extensions/api/commands/command_service.cc File chrome/browser/extensions/api/commands/command_service.cc (right): https://codereview.chromium.org/904943003/diff/180001/chrome/browser/extensions/api/commands/command_service.cc#newcode319 chrome/browser/extensions/api/commands/command_service.cc:319: return; On 2015/02/18 23:10:55, tapted wrote: > On 2015/02/18 ...
5 years, 10 months ago (2015-02-18 23:22:26 UTC) #32
Finnur
Kalman: See comment at bottom of this message). Was travelling yesterday, so I didn't see ...
5 years, 10 months ago (2015-02-20 10:31:49 UTC) #33
not at google - send to devlin
Sorry for not keeping up with this code review, these questions are probably covered, and ...
5 years, 10 months ago (2015-02-20 16:14:50 UTC) #35
Finnur
Got 6 mins until my train leaves to write this email. Hence brief replies. Hope ...
5 years, 10 months ago (2015-02-20 16:40:13 UTC) #36
David Tseng
With regard to fixing the underlying issue, I think we need to resolve the question ...
5 years, 10 months ago (2015-02-20 18:01:10 UTC) #38
not at google - send to devlin
On 2015/02/20 18:01:10, David Tseng wrote: > With regard to fixing the underlying issue, I ...
5 years, 10 months ago (2015-02-20 18:12:12 UTC) #39
not at google - send to devlin
however, lgtm, let's get this patch in for now to fix the bug before branch.
5 years, 10 months ago (2015-02-20 18:12:32 UTC) #40
David Tseng
https://codereview.chromium.org/904943003/diff/180001/chrome/browser/extensions/extension_keybinding_apitest.cc File chrome/browser/extensions/extension_keybinding_apitest.cc (right): https://codereview.chromium.org/904943003/diff/180001/chrome/browser/extensions/extension_keybinding_apitest.cc#newcode961 chrome/browser/extensions/extension_keybinding_apitest.cc:961: IN_PROC_BROWSER_TEST_F(CommandsApiTest, Component) { On 2015/02/20 10:31:49, Finnur wrote: > ...
5 years, 10 months ago (2015-02-20 18:12:45 UTC) #41
Mike Wittman
On my part, this change looks good but this comment from patch set 7 is ...
5 years, 10 months ago (2015-02-20 18:59:30 UTC) #43
David Tseng
https://codereview.chromium.org/904943003/diff/120001/chrome/test/data/extensions/api_test/keybinding/component/background.js File chrome/test/data/extensions/api_test/keybinding/component/background.js (right): https://codereview.chromium.org/904943003/diff/120001/chrome/test/data/extensions/api_test/keybinding/component/background.js#newcode9 chrome/test/data/extensions/api_test/keybinding/component/background.js:9: chrome.test.assertEq(platformBinding, commands[0].shortcut); On 2015/02/13 22:11:20, Mike Wittman wrote: > ...
5 years, 10 months ago (2015-02-20 19:13:37 UTC) #44
Mike Wittman
lgtm https://codereview.chromium.org/904943003/diff/120001/chrome/test/data/extensions/api_test/keybinding/component/background.js File chrome/test/data/extensions/api_test/keybinding/component/background.js (right): https://codereview.chromium.org/904943003/diff/120001/chrome/test/data/extensions/api_test/keybinding/component/background.js#newcode9 chrome/test/data/extensions/api_test/keybinding/component/background.js:9: chrome.test.assertEq(platformBinding, commands[0].shortcut); On 2015/02/20 19:13:37, David Tseng wrote: ...
5 years, 10 months ago (2015-02-20 19:21:11 UTC) #45
Anand Mistry (off Chromium)
On 2015/02/20 16:14:50, kalman wrote: > 2. The old enum this used for this, UNINSTALL_REASON_INTERNAL_MANAGEMENT, ...
5 years, 10 months ago (2015-02-22 23:50:35 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/904943003/240001
5 years, 10 months ago (2015-02-23 16:21:56 UTC) #48
commit-bot: I haz the power
Committed patchset #13 (id:240001)
5 years, 10 months ago (2015-02-23 17:24:28 UTC) #49
commit-bot: I haz the power
5 years, 10 months ago (2015-02-23 17:24:58 UTC) #50
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/9fb3d5b62a6466053aeee3a26c0d0a898428f4eb
Cr-Commit-Position: refs/heads/master@{#317602}

Powered by Google App Engine
This is Rietveld 408576698