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

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

Issue 7605001: Extensions installed by policy overrun previously installed extensions. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Reviewed, rebased Created 9 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/extensions/extension_updater.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/pending_extension_manager.cc
diff --git a/chrome/browser/extensions/pending_extension_manager.cc b/chrome/browser/extensions/pending_extension_manager.cc
index d4446a95c639f1632d1c6cd5da12d72ef88c1166..c978415f5c2fe734b63bbc410285077ebdecbc0c 100644
--- a/chrome/browser/extensions/pending_extension_manager.cc
+++ b/chrome/browser/extensions/pending_extension_manager.cc
@@ -74,13 +74,21 @@ void PendingExtensionManager::AddFromExternalUpdateUrl(
const bool kIsFromSync = false;
const bool kInstallSilently = true;
- if (service_.IsExternalExtensionUninstalled(id))
- return;
-
- if (service_.GetInstalledExtension(id)) {
- LOG(DFATAL) << "Trying to add extension " << id
- << " by external update, but it is already installed.";
- return;
+ const Extension* extension = service_.GetInstalledExtension(id);
+ if (extension &&
+ location == Extension::GetHigherPriorityLocation(location,
+ extension->location())) {
+ // If the new location has higher priority than the location of an existing
+ // extension, let the update process overwrite the existing extension.
+ } else {
+ if (service_.IsExternalExtensionUninstalled(id)) {
+ return;
+ }
+ if (extension) {
+ LOG(DFATAL) << "Trying to add extension " << id
+ << " by external update, but it is already installed.";
+ return;
+ }
}
AddExtensionImpl(id, update_url, &AlwaysInstall,
« no previous file with comments | « chrome/browser/extensions/extension_updater.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698