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

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

Issue 289073008: Add TriggerOnUninstalled to ExtensionRegistry (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
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model.h ('k') | extensions/browser/extension_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_toolbar_model.cc
diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc
index 7c9d5bfdd08beba10b31aa2edef74cecebfb399d..41091bd3406b434ec297f39710b9bbbef0e5757a 100644
--- a/chrome/browser/extensions/extension_toolbar_model.cc
+++ b/chrome/browser/extensions/extension_toolbar_model.cc
@@ -191,32 +191,27 @@ void ExtensionToolbarModel::OnExtensionUnloaded(
RemoveExtension(extension);
}
+void ExtensionToolbarModel::OnExtensionUninstalled(
+ content::BrowserContext* browser_context,
+ const Extension* extension) {
+ UninstalledExtension(extension);
not at google - send to devlin 2014/05/23 20:24:05 given the only caller of UninstalledExtension is h
limasdf 2014/05/23 20:47:22 Done.
+}
+
void ExtensionToolbarModel::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- switch (type) {
- case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: {
- const Extension* extension =
- content::Details<const Extension>(details).ptr();
- UninstalledExtension(extension);
- break;
- }
- case chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED: {
- const Extension* extension =
- ExtensionRegistry::Get(profile_)->GetExtensionById(
- *content::Details<const std::string>(details).ptr(),
- ExtensionRegistry::EVERYTHING);
- if (ExtensionActionAPI::GetBrowserActionVisibility(extension_prefs_,
- extension->id())) {
- AddExtension(extension);
- } else {
- RemoveExtension(extension);
- }
- break;
- }
- default:
- NOTREACHED() << "Received unexpected notification";
+ DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
+ type);
+ const Extension* extension =
+ ExtensionRegistry::Get(profile_)->GetExtensionById(
+ *content::Details<const std::string>(details).ptr(),
+ ExtensionRegistry::EVERYTHING);
+ if (ExtensionActionAPI::GetBrowserActionVisibility(extension_prefs_,
+ extension->id())) {
+ AddExtension(extension);
+ } else {
+ RemoveExtension(extension);
}
}
@@ -227,9 +222,6 @@ void ExtensionToolbarModel::OnReady() {
// changes so that the toolbar buttons can be shown in their stable ordering
// taken from prefs.
extension_registry_observer_.Add(registry);
- registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
- content::Source<Profile>(profile_));
registrar_.Add(
this,
chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
@@ -589,6 +581,6 @@ void ExtensionToolbarModel::StopHighlighting() {
}
FOR_EACH_OBSERVER(Observer, observers_, HighlightModeChanged(false));
}
-};
+}
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model.h ('k') | extensions/browser/extension_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698