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

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

Issue 369863002: Revert 281130 "Replace "external_install" boolean parameter with..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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: trunk/src/chrome/browser/extensions/extension_service.cc
===================================================================
--- trunk/src/chrome/browser/extensions/extension_service.cc (revision 281226)
+++ trunk/src/chrome/browser/extensions/extension_service.cc (working copy)
@@ -168,7 +168,7 @@
<< "with id: " << id;
return;
}
- UninstallExtension(id, UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION, NULL);
+ UninstallExtension(id, true, NULL);
}
void ExtensionService::SetFileTaskRunnerForTesting(
@@ -231,13 +231,13 @@
}
// static
-// 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.
+// 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.
bool ExtensionService::UninstallExtensionHelper(
ExtensionService* extensions_service,
- const std::string& extension_id,
- UninstallReason reason) {
+ const std::string& extension_id) {
// 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 "
@@ -248,7 +248,7 @@
// The following call to UninstallExtension will not allow an uninstall of a
// policy-controlled extension.
base::string16 error;
- if (!extensions_service->UninstallExtension(extension_id, reason, &error)) {
+ if (!extensions_service->UninstallExtension(extension_id, false, &error)) {
LOG(WARNING) << "Cannot uninstall extension with id " << extension_id
<< ": " << error;
return false;
@@ -694,7 +694,7 @@
// "transient" because the process of uninstalling may cause the reference
// to become invalid. Instead, use |extenson->id()|.
const std::string& transient_extension_id,
- UninstallReason reason,
+ bool external_uninstall,
base::string16* error) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -713,9 +713,6 @@
// 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 == UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION) ||
- (reason == UNINSTALL_REASON_ORPHANED_SHARED_MODULE);
if (!external_uninstall &&
!system_->management_policy()->UserMayModifySettings(
extension.get(), error)) {

Powered by Google App Engine
This is Rietveld 408576698