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

Issue 2893693002: Remove NOTIFICATION_EXTENSION_ENABLED. (Closed)

Created:
3 years, 7 months ago by lazyboy
Modified:
3 years, 6 months ago
Reviewers:
Devlin, pkotwicz
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove NOTIFICATION_EXTENSION_ENABLED. Enablement can happen for the following 3 cases: 1. New extension is added 2. User enables a disabled extension 3. An extension is reloaded or a terminated extension is reloaded It seems we used this in two classes in a) theme_service.cc and b) event_router.cc a) For themes, this can be simplified to load the theme on OnExtensionLoaded. Themes don't have process and it can't be terminated. We still have to remember whether the load is due to a theme update or not (OnExtensionWillBeInstalled). It is possible to avoid this by remembering both current theme's id (already done) and version in the prefs. This CL does not do that. b) The primary reason of EventRouter code is to make sure we are aware of new lazy events on extension upgrade, and to dispatch onInstalled event. The CL wraps the logic to use OnExtensionWillBeInstalled + OnExtensionLoaded into a separate class: LazyEventDispatchUtil. However, there are also 2 other reasons for EventRouter code in b): b1) We also need to reconnect devtools to a reloaded event page. That was happening through event_router. Pull that logic into extension_service as extension_service is already responsible for remembering orphaned devtools. b2) A component extension reload does not go through ExtensionRegistry::TriggerOnInstalled, so it doesn't see any OnExtensionWillBeInstalled. Couple the logic with b1). TBR=benwells@chromium.org for added test in app_browsertest.cc BUG=723754, 411569 Test=No visible changes expected. Review-Url: https://codereview.chromium.org/2893693002 Cr-Commit-Position: refs/heads/master@{#477357} Committed: https://chromium.googlesource.com/chromium/src/+/75b9def1648c17c0edc926e7ea787519e9c59899

Patch Set 1 #

Total comments: 11

Patch Set 2 : simplify theme code #

Patch Set 3 : temp upload #

Patch Set 4 : connect devtools #

Total comments: 16

Patch Set 5 : address comments #

Total comments: 8

Patch Set 6 : sync + address comments #

Total comments: 2

Patch Set 7 : address comments + fix theme update path for skipping already set theme #

Total comments: 2

Patch Set 8 : comments #

Patch Set 9 : add code for component reload #

Total comments: 11

Patch Set 10 : JS comments #

Patch Set 11 : sync and rebase theme_service.cc #

Total comments: 4

Patch Set 12 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+589 lines, -162 lines) Patch
M chrome/browser/apps/app_browsertest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +18 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/input_ime/input_ime_api.h View 2 chunks +1 line, -4 lines 0 comments Download
M chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.h View 2 chunks +1 line, -1 line 0 comments Download
M chrome/browser/extensions/events_apitest.cc View 1 2 3 4 5 2 chunks +146 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_service.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_service.cc View 1 2 3 4 5 6 7 8 4 chunks +30 lines, -5 lines 0 comments Download
M chrome/browser/themes/theme_service.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +28 lines, -21 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/new_event_in_new_version/pem.pem View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/new_event_in_new_version/v1/background.js View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/new_event_in_new_version/v1/manifest.json View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/new_event_in_new_version/v2/background.js View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/new_event_in_new_version/v2/manifest.json View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/on_installed/pem.pem View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/on_installed/v1/background.js View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/on_installed/v1/manifest.json View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/on_installed/v2/background.js View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/on_installed/v2/manifest.json View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/on_installed_permissions_increase/pem.pem View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/on_installed_permissions_increase/v1/background.js View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/on_installed_permissions_increase/v1/manifest.json View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/on_installed_permissions_increase/v2/background.js View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/lazy_events/on_installed_permissions_increase/v2/manifest.json View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/component_reload/background.js View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/component_reload/manifest.json View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -0 lines 0 comments Download
M extensions/browser/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/browser/api/runtime/runtime_api.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +9 lines, -13 lines 0 comments Download
M extensions/browser/api/runtime/runtime_api.cc View 1 2 3 4 5 7 chunks +18 lines, -79 lines 0 comments Download
M extensions/browser/event_router.h View 1 2 3 4 5 6 chunks +7 lines, -8 lines 0 comments Download
M extensions/browser/event_router.cc View 1 2 3 4 5 6 7 5 chunks +2 lines, -23 lines 0 comments Download
A extensions/browser/events/lazy_event_dispatch_util.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +74 lines, -0 lines 0 comments Download
A extensions/browser/events/lazy_event_dispatch_util.cc View 1 2 3 4 5 1 chunk +121 lines, -0 lines 0 comments Download
M extensions/browser/notification_types.h View 1 chunk +0 lines, -7 lines 0 comments Download

Messages

Total messages: 78 (49 generated)
lazyboy
https://codereview.chromium.org/2893693002/diff/1/chrome/browser/extensions/api/input_ime/input_ime_api.h File chrome/browser/extensions/api/input_ime/input_ime_api.h (right): https://codereview.chromium.org/2893693002/diff/1/chrome/browser/extensions/api/input_ime/input_ime_api.h#newcode21 chrome/browser/extensions/api/input_ime/input_ime_api.h:21: #include "content/public/browser/notification_registrar.h" This was transitively being included through EventRouter. ...
3 years, 7 months ago (2017-05-17 18:14:48 UTC) #4
Devlin
I'm wondering if we need an extension enabled notification at all, or if we can ...
3 years, 7 months ago (2017-05-17 18:37:49 UTC) #6
lazyboy
(answering questions) https://codereview.chromium.org/2893693002/diff/1/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/2893693002/diff/1/chrome/browser/themes/theme_service.cc#newcode195 chrome/browser/themes/theme_service.cc:195: void OnExtensionEnabled(content::BrowserContext* browser_context, On 2017/05/17 18:37:48, Devlin ...
3 years, 7 months ago (2017-05-17 22:23:25 UTC) #9
Devlin
https://codereview.chromium.org/2893693002/diff/1/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/2893693002/diff/1/chrome/browser/themes/theme_service.cc#newcode195 chrome/browser/themes/theme_service.cc:195: void OnExtensionEnabled(content::BrowserContext* browser_context, On 2017/05/17 22:23:25, lazyboy wrote: > ...
3 years, 7 months ago (2017-05-18 01:34:45 UTC) #10
lazyboy
@pkotwicz, can you check + review the cleanup/claim in theme_service.cc? Specifically OnExtensionLoaded(), thanks. https://codereview.chromium.org/2893693002/diff/1/chrome/browser/themes/theme_service.cc File ...
3 years, 7 months ago (2017-05-18 18:10:52 UTC) #12
Devlin
https://codereview.chromium.org/2893693002/diff/1/extensions/browser/event_router.cc File extensions/browser/event_router.cc (right): https://codereview.chromium.org/2893693002/diff/1/extensions/browser/event_router.cc#newcode762 extensions/browser/event_router.cc:762: void EventRouter::OnExtensionEnabled(content::BrowserContext* browser_context, On 2017/05/18 18:10:52, lazyboy wrote: > ...
3 years, 7 months ago (2017-05-18 18:39:47 UTC) #13
pkotwicz
I'll take a look at the CL by Tuesday. Sorry for the delay
3 years, 7 months ago (2017-05-19 18:51:50 UTC) #14
lazyboy
Please take another look. I've discovered a devtools reattachment issue via ExtensionLoadingTest.KeepAliveWithDevToolsOpenOnReload test failure, it ...
3 years, 7 months ago (2017-05-23 02:01:18 UTC) #20
Devlin
https://codereview.chromium.org/2893693002/diff/60001/chrome/browser/extensions/events_apitest.cc File chrome/browser/extensions/events_apitest.cc (right): https://codereview.chromium.org/2893693002/diff/60001/chrome/browser/extensions/events_apitest.cc#newcode103 chrome/browser/extensions/events_apitest.cc:103: ExtensionService* service() { There's already an extension_service() accessor on ...
3 years, 7 months ago (2017-05-23 21:30:37 UTC) #21
lazyboy
https://codereview.chromium.org/2893693002/diff/60001/chrome/browser/extensions/events_apitest.cc File chrome/browser/extensions/events_apitest.cc (right): https://codereview.chromium.org/2893693002/diff/60001/chrome/browser/extensions/events_apitest.cc#newcode103 chrome/browser/extensions/events_apitest.cc:103: ExtensionService* service() { On 2017/05/23 21:30:36, Devlin (catching up) ...
3 years, 7 months ago (2017-05-23 23:19:08 UTC) #22
pkotwicz
I am very sorry for the delay. There is the notion of enabling/disabling extensions in ...
3 years, 7 months ago (2017-05-25 16:13:37 UTC) #23
pkotwicz
I have not looked through all of the extensions interactions. I think your code is ...
3 years, 7 months ago (2017-05-25 20:52:25 UTC) #24
Devlin
lgtm as long as the bots are happy! https://codereview.chromium.org/2893693002/diff/80001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/2893693002/diff/80001/extensions/browser/api/runtime/runtime_api.cc#newcode213 extensions/browser/api/runtime/runtime_api.cc:213: EventRouter::Get(browser_context_) ...
3 years, 7 months ago (2017-05-25 21:08:45 UTC) #25
lazyboy
@pkotwicz, can you take another look? https://codereview.chromium.org/2893693002/diff/80001/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/2893693002/diff/80001/chrome/browser/themes/theme_service.cc#newcode176 chrome/browser/themes/theme_service.cc:176: const extensions::Extension* extension) ...
3 years, 6 months ago (2017-05-30 23:38:36 UTC) #28
pkotwicz
LGTM with nit https://codereview.chromium.org/2893693002/diff/100001/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/2893693002/diff/100001/chrome/browser/themes/theme_service.cc#newcode181 chrome/browser/themes/theme_service.cc:181: // out. Remove the comment because ...
3 years, 6 months ago (2017-05-31 15:46:53 UTC) #31
lazyboy
https://codereview.chromium.org/2893693002/diff/100001/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/2893693002/diff/100001/chrome/browser/themes/theme_service.cc#newcode181 chrome/browser/themes/theme_service.cc:181: // out. On 2017/05/31 15:46:53, pkotwicz wrote: > Remove ...
3 years, 6 months ago (2017-05-31 21:07:41 UTC) #34
pkotwicz
LGTM assuming that you have tested an auto updating theme. https://developer.chrome.com/extensions/autoupdate I don't know whether ...
3 years, 6 months ago (2017-05-31 21:53:36 UTC) #36
pkotwicz
LGTM assuming that you have tested an auto updating theme. https://developer.chrome.com/extensions/autoupdate I don't know whether ...
3 years, 6 months ago (2017-05-31 21:54:06 UTC) #37
lazyboy
re: assuming that you have tested an auto updating theme I've tested auto update path, ...
3 years, 6 months ago (2017-05-31 23:31:56 UTC) #38
pkotwicz
I just tested the auto update code path and it works! Thank you for clarifying ...
3 years, 6 months ago (2017-06-01 18:44:40 UTC) #43
lazyboy
@Devlin, can you take another look? Changes required further review: Patch Set 8 -> 9 ...
3 years, 6 months ago (2017-06-01 23:32:54 UTC) #47
Devlin
https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/apps/app_browsertest.cc File chrome/browser/apps/app_browsertest.cc (right): https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/apps/app_browsertest.cc#newcode958 chrome/browser/apps/app_browsertest.cc:958: // Now tell the app to reload itself nittiest ...
3 years, 6 months ago (2017-06-02 01:57:28 UTC) #50
lazyboy
https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/apps/app_browsertest.cc File chrome/browser/apps/app_browsertest.cc (right): https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/apps/app_browsertest.cc#newcode958 chrome/browser/apps/app_browsertest.cc:958: // Now tell the app to reload itself On ...
3 years, 6 months ago (2017-06-02 18:35:37 UTC) #51
Devlin
https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/extensions/extension_service.cc File chrome/browser/extensions/extension_service.cc (right): https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/extensions/extension_service.cc#newcode2570 chrome/browser/extensions/extension_service.cc:2570: // Reloading component extension does not trigger install, so ...
3 years, 6 months ago (2017-06-03 02:10:12 UTC) #60
lazyboy
https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/extensions/extension_service.cc File chrome/browser/extensions/extension_service.cc (right): https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/extensions/extension_service.cc#newcode2570 chrome/browser/extensions/extension_service.cc:2570: // Reloading component extension does not trigger install, so ...
3 years, 6 months ago (2017-06-03 02:18:52 UTC) #61
Devlin
lgtm https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/extensions/extension_service.cc File chrome/browser/extensions/extension_service.cc (right): https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/extensions/extension_service.cc#newcode2570 chrome/browser/extensions/extension_service.cc:2570: // Reloading component extension does not trigger install, ...
3 years, 6 months ago (2017-06-05 15:38:38 UTC) #62
lazyboy
https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/extensions/extension_service.cc File chrome/browser/extensions/extension_service.cc (right): https://codereview.chromium.org/2893693002/diff/160001/chrome/browser/extensions/extension_service.cc#newcode2570 chrome/browser/extensions/extension_service.cc:2570: // Reloading component extension does not trigger install, so ...
3 years, 6 months ago (2017-06-05 21:54:01 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2893693002/220001
3 years, 6 months ago (2017-06-06 18:52:03 UTC) #75
commit-bot: I haz the power
3 years, 6 months ago (2017-06-06 18:57:13 UTC) #78
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/75b9def1648c17c0edc926e7ea78...

Powered by Google App Engine
This is Rietveld 408576698