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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 462533002: Make runtime.reload() work with component extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix segfault in test... I think. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/apps/app_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 68ae5822feb842789917b7326b115b45becdc26e..6d74c10646a17c9896e9527e58b491d222f3a1f6 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -824,7 +824,17 @@ void ExtensionService::EnableExtension(const std::string& extension_id) {
return;
}
- extension_prefs_->SetExtensionState(extension_id, Extension::ENABLED);
+ if (extension && extension->manifest() &&
+ extension->manifest()->location() == Manifest::COMPONENT) {
+ // Component extensions need to be put into the "ENABLED_COMPONENT",
benwells 2014/08/12 04:17:14 Um. Hmm. ENABLED_COMPONENT feels pretty strange. D
Anand Mistry (off Chromium) 2014/08/12 05:06:42 Adding Trent since he introduced this in https://s
tapted 2014/08/12 05:39:06 Woww so long ago. That was one of my first chrome
Anand Mistry (off Chromium) 2014/08/12 07:32:10 Removed the ENABLED_COMPONENT state, but not sure
+ // otherwise, other things break later on
+ // (*cough* ExtensionPrefs::GetInstalledExtensionInfo()) that rely on
+ // component extensions being in that state.
+ extension_prefs_->SetExtensionState(extension_id,
+ Extension::ENABLED_COMPONENT);
+ } else {
+ extension_prefs_->SetExtensionState(extension_id, Extension::ENABLED);
+ }
extension_prefs_->ClearDisableReasons(extension_id);
// This can happen if sync enables an extension that is not
« no previous file with comments | « chrome/browser/apps/app_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698