| Index: chrome/browser/extensions/extension_service.cc
|
| diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
|
| index b72df86857ff5978d3583103cd47d3c6d169c86f..14e0350c185ed2df6639a853328068db9c7f3e61 100644
|
| --- a/chrome/browser/extensions/extension_service.cc
|
| +++ b/chrome/browser/extensions/extension_service.cc
|
| @@ -415,12 +415,19 @@ void ExtensionService::OnExternalExtensionUpdateUrlFound(
|
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| CHECK(Extension::IdIsValid(id));
|
|
|
| - if (GetExtensionById(id, true)) {
|
| - // Already installed. Do not change the update URL that the extension set.
|
| - return;
|
| + bool overwrite = false;
|
| + const Extension* extension = GetExtensionById(id, true);
|
| + if (extension) {
|
| + // Already installed. Skip this install if the current location has
|
| + // higher priority than |location|.
|
| + Extension::Location current = extension->location();
|
| + if (current == Extension::GetHigherPriorityLocation(current, location))
|
| + return;
|
| + // Otherwise, overwrite the current installation.
|
| + overwrite = true;
|
| }
|
| pending_extension_manager()->AddFromExternalUpdateUrl(
|
| - id, update_url, location);
|
| + id, update_url, location, overwrite);
|
| external_extension_url_added_ |= true;
|
| }
|
|
|
| @@ -2163,7 +2170,11 @@ void ExtensionService::OnExtensionInstalled(
|
| // Ensure extension is deleted unless we transfer ownership.
|
| scoped_refptr<const Extension> scoped_extension(extension);
|
| const std::string& id = extension->id();
|
| - bool initial_enable = !extension_prefs_->IsExtensionDisabled(id);
|
| + // Extensions installed by policy can't be disabled. So even if a previous
|
| + // installation disabled the extension, make sure it is now enabled.
|
| + bool initial_enable =
|
| + !extension_prefs_->IsExtensionDisabled(id) ||
|
| + !Extension::UserMayDisable(extension->location());
|
| PendingExtensionInfo pending_extension_info;
|
| if (pending_extension_manager()->GetById(id, &pending_extension_info)) {
|
| pending_extension_manager()->Remove(id);
|
|
|