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 |