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

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

Issue 21443002: Add NOTIFICATION_EXTENSION_REMOVED for Extensions removed from ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « chrome/browser/extensions/extension_disabled_ui.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.h
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 15645875447357ba74104449b8a584ce725fe9b2..d12903b25a0214a8dd61a441f76b7b53d1918cf0 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -15,6 +15,7 @@
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
#include "base/prefs/pref_change_registrar.h"
#include "base/strings/string16.h"
#include "chrome/browser/extensions/app_sync_bundle.h"
@@ -135,6 +136,16 @@ class ExtensionService
public content::NotificationObserver,
public extensions::Blacklist::Observer {
public:
+ class DisabledExtensionObserver {
+ public:
+ // Called when an extension is removed from the disabled extensions list.
+ // |was_enabled| is true if it was enabled, false if it was blacklisted
+ // or uninstalled.
+ virtual void OnDisabledExtensionRemoved(
Matt Perry 2013/08/01 00:37:33 This seems oddly specific. I think it should be sp
Yoyo Zhou 2013/08/01 00:46:40 To be clear, there are paths which result in an Ex
+ const extensions::Extension* extension,
+ bool was_enabled) = 0;
+ };
+
// If auto-updates are turned on, default to running every 5 hours.
static const int kDefaultUpdateFrequencySeconds = 60 * 60 * 5;
@@ -685,6 +696,10 @@ class ExtensionService
install_updates_when_idle_ = value;
}
+ // Adds/Removes disabled extension observers.
+ void AddDisabledExtensionObserver(DisabledExtensionObserver* observer);
+ void RemoveDisabledExtensionObserver(DisabledExtensionObserver* observer);
+
// Adds/Removes update observers.
void AddUpdateObserver(extensions::UpdateObserver* observer);
void RemoveUpdateObserver(extensions::UpdateObserver* observer);
@@ -949,6 +964,7 @@ class ExtensionService
extension_action_storage_manager_;
#endif
+ ObserverList<DisabledExtensionObserver, true> disabled_extension_observers_;
ObserverList<extensions::UpdateObserver, true> update_observers_;
// Run()ning tells sync to try and start soon, because syncable changes
« no previous file with comments | « chrome/browser/extensions/extension_disabled_ui.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698