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

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: More tests. 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/pending_extension_manager.h ('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..fece1bebc2c4ff2b3ecdc72d4a993b01a43f3e59 100644
--- a/chrome/browser/extensions/pending_extension_manager.cc
+++ b/chrome/browser/extensions/pending_extension_manager.cc
@@ -68,19 +68,22 @@ bool PendingExtensionManager::AddFromSync(
void PendingExtensionManager::AddFromExternalUpdateUrl(
const std::string& id, const GURL& update_url,
- Extension::Location location) {
+ Extension::Location location, bool overwrite) {
Sam Kerner (Chrome) 2011/08/10 17:21:09 There are two reasons |overwrite| is useful: 1) T
Joao da Silva 2011/08/11 10:03:23 Done.
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
const bool kIsFromSync = false;
const bool kInstallSilently = true;
- if (service_.IsExternalExtensionUninstalled(id))
- return;
+ if (!overwrite) {
+ 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;
+ if (service_.GetInstalledExtension(id)) {
+ 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/pending_extension_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698