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

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

Issue 284103002: Replace "external_install" boolean parameter with explicit enumeration in ExtensionUninstall method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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.h
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 03f18a1957bce230be6e745614a80eefb2d8d16b..1cf996957a51f6d861ce2c76565cc9ab121aeab9 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -128,10 +128,21 @@ class ExtensionService
public content::NotificationObserver,
public extensions::Blacklist::Observer {
public:
+ enum UninstallReason {
+ kUninstallReasonDefault,
Devlin 2014/05/14 23:14:20 For better or worse, Extensions code overwhelmingl
rpaquay 2014/06/30 23:16:18 Done.
+ kUninstallReasonOrphanedSharedModule,
+ kUninstallReasonOrphanedTheme,
+ kUninstallReasonOrphanedExternalExtension,
+ kUninstallReasonOrphanedEphemeralExtension,
+ kUninstallReasonUserInitiated,
+ kUninstallReasonSynch,
Devlin 2014/05/14 23:14:20 nit: "Sync" is more common spelling in the code.
rpaquay 2014/06/30 23:16:18 Done.
+ };
+
// Attempts to uninstall an extension from a given ExtensionService. Returns
// true iff the target extension exists.
static bool UninstallExtensionHelper(ExtensionService* extensions_service,
- const std::string& extension_id);
+ const std::string& extension_id,
+ UninstallReason reason);
// Constructor stores pointers to |profile| and |extension_prefs| but
// ownership remains at caller.
@@ -196,18 +207,10 @@ class ExtensionService
void ReloadExtension(const std::string extension_id);
// Uninstalls the specified extension. Callers should only call this method
- // with extensions that exist. |external_uninstall| is a magical parameter
- // that is only used to send information to ExtensionPrefs, which external
- // callers should never set to true.
- //
- // We pass the |extension_id| by value to avoid having it deleted from under
- // us incase someone calls it with Extension::id() or another string that we
- // are going to delete in this function.
- //
- // TODO(aa): Remove |external_uninstall| -- this information should be passed
- // to ExtensionPrefs some other way.
+ // with extensions that exist. |reason| lets the caller specify why the
+ // extension is uninstalled.
virtual bool UninstallExtension(const std::string& extension_id,
- bool external_uninstall,
+ UninstallReason reason,
base::string16* error);
virtual bool IsExtensionEnabled(

Powered by Google App Engine
This is Rietveld 408576698