summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/bookmark_bar_view.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-01 18:16:56 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-01 18:16:56 +0000
commitbfd04a62ce610d7bb61dbb78811dccbed23589b7 (patch)
tree70bb228c0f00ba1c12c584efd569daccf96b4026 /chrome/browser/views/bookmark_bar_view.cc
parenta814d863440f0a154a7299f2d8b440f405c7700e (diff)
downloadchromium_src-bfd04a62ce610d7bb61dbb78811dccbed23589b7.zip
chromium_src-bfd04a62ce610d7bb61dbb78811dccbed23589b7.tar.gz
chromium_src-bfd04a62ce610d7bb61dbb78811dccbed23589b7.tar.bz2
Remove most header file dependencies on the notification type list. It is
really painful to add more types, since lots of headers include the notification service to derive from the notification observer. This splits that out, so much less of the project should end up including notification_types.h ---Paths modified but not in any changelist: Review URL: http://codereview.chromium.org/19744 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/bookmark_bar_view.cc')
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index 438bb34..f1f8d3e 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -30,7 +30,6 @@
#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/notification_service.h"
-#include "chrome/common/notification_types.h"
#include "chrome/common/os_exchange_data.h"
#include "chrome/common/page_transition_types.h"
#include "chrome/common/pref_names.h"
@@ -667,7 +666,8 @@ void BookmarkBarView::ToggleWhenVisible(Profile* profile) {
// And notify the notification service.
Source<Profile> source(profile);
NotificationService::current()->Notify(
- NOTIFY_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, source,
+ NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
+ source,
NotificationService::NoDetails());
}
@@ -736,9 +736,9 @@ void BookmarkBarView::SetProfile(Profile* profile) {
NotificationService* ns = NotificationService::current();
Source<Profile> ns_source(profile_->GetOriginalProfile());
- ns->AddObserver(this, NOTIFY_BOOKMARK_BUBBLE_SHOWN, ns_source);
- ns->AddObserver(this, NOTIFY_BOOKMARK_BUBBLE_HIDDEN, ns_source);
- ns->AddObserver(this, NOTIFY_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
+ ns->AddObserver(this, NotificationType::BOOKMARK_BUBBLE_SHOWN, ns_source);
+ ns->AddObserver(this, NotificationType::BOOKMARK_BUBBLE_HIDDEN, ns_source);
+ ns->AddObserver(this, NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
NotificationService::AllSources());
model_ = profile_->GetBookmarkModel();
@@ -1525,8 +1525,8 @@ void BookmarkBarView::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(profile_);
- switch (type) {
- case NOTIFY_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED:
+ switch (type.value) {
+ case NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED:
if (IsAlwaysShown()) {
size_animation_->Show();
} else {
@@ -1534,13 +1534,13 @@ void BookmarkBarView::Observe(NotificationType type,
}
break;
- case NOTIFY_BOOKMARK_BUBBLE_SHOWN:
+ case NotificationType::BOOKMARK_BUBBLE_SHOWN:
StopThrobbing(true);
bubble_url_ = *(Details<GURL>(details).ptr());
StartThrobbing();
break;
- case NOTIFY_BOOKMARK_BUBBLE_HIDDEN:
+ case NotificationType::BOOKMARK_BUBBLE_HIDDEN:
StopThrobbing(false);
bubble_url_ = GURL();
break;
@@ -1550,9 +1550,10 @@ void BookmarkBarView::Observe(NotificationType type,
void BookmarkBarView::RemoveNotificationObservers() {
NotificationService* ns = NotificationService::current();
Source<Profile> ns_source(profile_->GetOriginalProfile());
- ns->RemoveObserver(this, NOTIFY_BOOKMARK_BUBBLE_SHOWN, ns_source);
- ns->RemoveObserver(this, NOTIFY_BOOKMARK_BUBBLE_HIDDEN, ns_source);
- ns->RemoveObserver(this, NOTIFY_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
+ ns->RemoveObserver(this, NotificationType::BOOKMARK_BUBBLE_SHOWN, ns_source);
+ ns->RemoveObserver(this, NotificationType::BOOKMARK_BUBBLE_HIDDEN, ns_source);
+ ns->RemoveObserver(this,
+ NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
NotificationService::AllSources());
}