Index: chrome/browser/extensions/extension_service.cc |
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc |
index 037abdbbdbe63e221bd4e4d1888fafcbb310cb18..df9d82758190593f162257342547f7fd9a1eeab7 100644 |
--- a/chrome/browser/extensions/extension_service.cc |
+++ b/chrome/browser/extensions/extension_service.cc |
@@ -171,7 +171,7 @@ void ExtensionService::CheckExternalUninstall(const std::string& id) { |
<< "with id: " << id; |
return; |
} |
- UninstallExtension(id, true, NULL); |
+ UninstallExtension(id, kUninstallReasonOrphanedExternalExtension, NULL); |
} |
void ExtensionService::SetFileTaskRunnerForTesting( |
@@ -234,13 +234,13 @@ bool ExtensionService::OnExternalExtensionUpdateUrlFound( |
} |
// static |
-// This function is used to implement the command-line switch |
-// --uninstall-extension, and to uninstall an extension via sync. The LOG |
-// statements within this function are used to inform the user if the uninstall |
-// cannot be done. |
+// This function is used to uninstall an extension via sync. The LOG statements |
+// within this function are used to inform the user if the uninstall cannot be |
+// done. |
bool ExtensionService::UninstallExtensionHelper( |
ExtensionService* extensions_service, |
- const std::string& extension_id) { |
+ const std::string& extension_id, |
+ UninstallReason reason) { |
// We can't call UninstallExtension with an invalid extension ID. |
if (!extensions_service->GetInstalledExtension(extension_id)) { |
LOG(WARNING) << "Attempted uninstallation of non-existent extension with " |
@@ -251,7 +251,7 @@ bool ExtensionService::UninstallExtensionHelper( |
// The following call to UninstallExtension will not allow an uninstall of a |
// policy-controlled extension. |
base::string16 error; |
- if (!extensions_service->UninstallExtension(extension_id, false, &error)) { |
+ if (!extensions_service->UninstallExtension(extension_id, reason, &error)) { |
LOG(WARNING) << "Cannot uninstall extension with id " << extension_id |
<< ": " << error; |
return false; |
@@ -662,7 +662,7 @@ void ExtensionService::ReloadExtension(const std::string extension_id) { |
} |
bool ExtensionService::UninstallExtension(const std::string& extension_id, |
- bool external_uninstall, |
+ UninstallReason reason, |
base::string16* error) { |
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
@@ -680,6 +680,9 @@ bool ExtensionService::UninstallExtension(const std::string& extension_id, |
// TODO(rdevlin.cronin): This is probably not right. We should do something |
// else, like include an enum IS_INTERNAL_UNINSTALL or IS_USER_UNINSTALL so |
// we don't do this. |
+ bool external_uninstall = |
+ (reason == kUninstallReasonOrphanedExternalExtension) || |
+ (reason == kUninstallReasonOrphanedSharedModule); |
Devlin
2014/05/14 23:14:20
Shame this is still here... ah well.
|
if (!external_uninstall && |
!system_->management_policy()->UserMayModifySettings( |
extension.get(), error)) { |