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

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

Issue 398083002: Add "UninstallReason" parameter to ExtensionRegistryObserver::OnExtensionUninstalled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix header file. Created 6 years, 5 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 03d1faffd0c87fa6f704a3bb2eab9fe93431e077..22f001baa249083600e50324bf455aa8391f249b 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -60,6 +60,7 @@
#include "extensions/browser/install_flag.h"
#include "extensions/browser/pref_names.h"
#include "extensions/browser/runtime_data.h"
+#include "extensions/browser/uninstall_reason.h"
#include "extensions/browser/update_observer.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/feature_switch.h"
@@ -140,7 +141,8 @@ void ExtensionService::CheckExternalUninstall(const std::string& id) {
<< "with id: " << id;
return;
}
- UninstallExtension(id, UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION, NULL);
+ UninstallExtension(
+ id, extensions::UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION, NULL);
}
void ExtensionService::SetFileTaskRunnerForTesting(
@@ -209,7 +211,7 @@ bool ExtensionService::OnExternalExtensionUpdateUrlFound(
bool ExtensionService::UninstallExtensionHelper(
ExtensionService* extensions_service,
const std::string& extension_id,
- UninstallReason reason) {
+ extensions::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 "
@@ -677,7 +679,7 @@ bool ExtensionService::UninstallExtension(
// "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,
+ extensions::UninstallReason reason,
base::string16* error) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -697,9 +699,9 @@ bool ExtensionService::UninstallExtension(
// else, like include an enum IS_INTERNAL_UNINSTALL or IS_USER_UNINSTALL so
// we don't do this.
bool external_uninstall =
- (reason == UNINSTALL_REASON_INTERNAL_MANAGEMENT) ||
- (reason == UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION) ||
- (reason == UNINSTALL_REASON_ORPHANED_SHARED_MODULE);
+ (reason == extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT) ||
+ (reason == extensions::UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION) ||
+ (reason == extensions::UNINSTALL_REASON_ORPHANED_SHARED_MODULE);
if (!external_uninstall &&
!system_->management_policy()->UserMayModifySettings(
extension.get(), error)) {
@@ -748,7 +750,8 @@ bool ExtensionService::UninstallExtension(
chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
content::Source<Profile>(profile_),
content::Details<const Extension>(extension.get()));
- ExtensionRegistry::Get(profile_)->TriggerOnUninstalled(extension.get());
+ ExtensionRegistry::Get(profile_)
+ ->TriggerOnUninstalled(extension.get(), reason);
if (extension_sync_service_) {
extension_sync_service_->ProcessSyncUninstallExtension(extension->id(),
@@ -1290,7 +1293,8 @@ void ExtensionService::RemoveComponentExtension(
chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
content::Source<Profile>(profile_),
content::Details<const Extension>(extension.get()));
- ExtensionRegistry::Get(profile_)->TriggerOnUninstalled(extension.get());
+ ExtensionRegistry::Get(profile_)->TriggerOnUninstalled(
+ extension.get(), extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT);
}
}
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698