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

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: 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 776e7eb25e178699a142a9557d3551e4c44ae860..0cb791593f60d4d43ea2409bb3156869df014ea7 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -718,6 +718,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 &&
@@ -733,7 +734,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());
}
@@ -774,7 +778,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);
}

Powered by Google App Engine
This is Rietveld 408576698