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

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

Issue 557953005: Allow the user to "repair" a corrupted extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest Master Created 6 years, 3 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
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index e7d46ef1f005fea733c22b7551855b983b3c3b72..3f1b472ec565e28a5be339c53da29f07da63ae60 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -699,6 +699,7 @@ bool ExtensionService::UninstallExtension(
// we don't do this.
bool external_uninstall =
(reason == extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT) ||
+ (reason == extensions::UNINSTALL_REASON_REINSTALL) ||
(reason == extensions::UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION) ||
(reason == extensions::UNINSTALL_REASON_ORPHANED_SHARED_MODULE) ||
(reason == extensions::UNINSTALL_REASON_SYNC &&
@@ -714,7 +715,10 @@ bool ExtensionService::UninstallExtension(
}
syncer::SyncChange sync_change;
- if (extension_sync_service_) {
+ // Don't sync the uninstall if we're going to reinstall the extension
+ // momentarily.
+ if (extension_sync_service_ &&
+ reason != extensions::UNINSTALL_REASON_REINSTALL) {
sync_change = extension_sync_service_->PrepareToSyncUninstallExtension(
extension.get(), is_ready());
}
@@ -755,7 +759,7 @@ bool ExtensionService::UninstallExtension(
ExtensionRegistry::Get(profile_)
->TriggerOnUninstalled(extension.get(), reason);
- if (extension_sync_service_) {
+ if (sync_change.IsValid()) {
extension_sync_service_->ProcessSyncUninstallExtension(extension->id(),
sync_change);
}
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.cc ('k') | chrome/browser/extensions/webstore_installer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698