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

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

Issue 196753002: [Hotword] Making enabling/disabling the setting enable/disable the hotword extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove is_app and test Created 6 years, 9 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/extensions/component_loader_unittest.cc ('k') | chrome/browser/search/hotword_service.h » ('j') | 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 a74de002987077876c71a5b99854424acaa926b9..b8a78276c18ee79503e4ae44d3a76013317fe657 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1065,16 +1065,19 @@ void ExtensionService::DisableUserExtensions(
system_->management_policy();
extensions::ExtensionList to_disable;
+ // TODO(rlp): Clean up this code. crbug.com/353266.
const ExtensionSet& enabled_set = registry_->enabled_extensions();
for (ExtensionSet::const_iterator extension = enabled_set.begin();
extension != enabled_set.end(); ++extension) {
- if (management_policy->UserMayModifySettings(extension->get(), NULL))
+ if (management_policy->UserMayModifySettings(extension->get(), NULL) &&
+ extension->get()->location() != Manifest::EXTERNAL_COMPONENT)
to_disable.push_back(*extension);
}
const ExtensionSet& terminated_set = registry_->terminated_extensions();
for (ExtensionSet::const_iterator extension = terminated_set.begin();
extension != terminated_set.end(); ++extension) {
- if (management_policy->UserMayModifySettings(extension->get(), NULL))
+ if (management_policy->UserMayModifySettings(extension->get(), NULL) &&
+ extension->get()->location() != Manifest::EXTERNAL_COMPONENT)
to_disable.push_back(*extension);
}
@@ -2643,8 +2646,13 @@ void ExtensionService::SetBeingReloaded(const std::string& extension_id,
bool ExtensionService::ShouldEnableOnInstall(const Extension* extension) {
// Extensions installed by policy can't be disabled. So even if a previous
// installation disabled the extension, make sure it is now enabled.
- if (system_->management_policy()->MustRemainEnabled(extension, NULL))
+ // TODO(rlp): Clean up the special case for external components as noted
+ // in crbug.com/353266. For now, EXTERNAL_COMPONENT apps should be
+ // default enabled on install as before.
+ if (system_->management_policy()->MustRemainEnabled(extension, NULL) ||
+ extension->location() == Manifest::EXTERNAL_COMPONENT) {
return true;
+ }
if (extension_prefs_->IsExtensionDisabled(extension->id()))
return false;
« no previous file with comments | « chrome/browser/extensions/component_loader_unittest.cc ('k') | chrome/browser/search/hotword_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698