diff options
Diffstat (limited to 'chrome/browser/extensions/extension_toolbar_model.cc')
-rw-r--r-- | chrome/browser/extensions/extension_toolbar_model.cc | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc index 659f7a4..d71f620 100644 --- a/chrome/browser/extensions/extension_toolbar_model.cc +++ b/chrome/browser/extensions/extension_toolbar_model.cc @@ -8,6 +8,7 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/pref_names.h" #include "content/common/notification_service.h" @@ -18,15 +19,15 @@ ExtensionToolbarModel::ExtensionToolbarModel(ExtensionService* service) extensions_initialized_(false) { DCHECK(service_); - registrar_.Add(this, NotificationType::EXTENSION_LOADED, + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, Source<Profile>(service_->profile())); - registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, Source<Profile>(service_->profile())); - registrar_.Add(this, NotificationType::EXTENSIONS_READY, + registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, Source<Profile>(service_->profile())); - registrar_.Add(this, - NotificationType::EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED, - NotificationService::AllSources()); + registrar_.Add( + this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED, + NotificationService::AllSources()); visible_icon_count_ = prefs_->GetInteger(prefs::kExtensionToolbarSize); } @@ -79,10 +80,10 @@ void ExtensionToolbarModel::SetVisibleIconCount(int count) { prefs_->ScheduleSavePersistentPrefs(); } -void ExtensionToolbarModel::Observe(NotificationType type, +void ExtensionToolbarModel::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NotificationType::EXTENSIONS_READY) { + if (type == chrome::NOTIFICATION_EXTENSIONS_READY) { InitializeExtensionList(); return; } @@ -91,12 +92,12 @@ void ExtensionToolbarModel::Observe(NotificationType type, return; const Extension* extension = NULL; - if (type == NotificationType::EXTENSION_UNLOADED) { + if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) { extension = Details<UnloadedExtensionInfo>(details)->extension; } else { extension = Details<const Extension>(details).ptr(); } - if (type == NotificationType::EXTENSION_LOADED) { + if (type == chrome::NOTIFICATION_EXTENSION_LOADED) { // We don't want to add the same extension twice. It may have already been // added by EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED below, if the user // hides the browser action and then disables and enables the extension. @@ -106,10 +107,11 @@ void ExtensionToolbarModel::Observe(NotificationType type, } if (service_->GetBrowserActionVisibility(extension)) AddExtension(extension); - } else if (type == NotificationType::EXTENSION_UNLOADED) { + } else if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) { RemoveExtension(extension); - } else if (type == - NotificationType::EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED) { + } else if ( + type == + chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED) { if (service_->GetBrowserActionVisibility(extension)) AddExtension(extension); else |