summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions/session_service.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/sessions/session_service.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/sessions/session_service.cc')
-rw-r--r--chrome/browser/sessions/session_service.cc27
1 files changed, 13 insertions, 14 deletions
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
index 4f5861e..5f060d8 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -24,7 +24,6 @@
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/notification_details.h"
#include "chrome/common/notification_service.h"
-#include "chrome/common/notification_types.h"
#include "chrome/common/scoped_vector.h"
#include "chrome/common/win_util.h"
@@ -366,17 +365,17 @@ SessionService::Handle SessionService::GetLastSession(
void SessionService::Init() {
// Register for the notifications we're interested in.
- registrar_.Add(this, NOTIFY_TAB_PARENTED,
+ registrar_.Add(this, NotificationType::TAB_PARENTED,
NotificationService::AllSources());
- registrar_.Add(this, NOTIFY_TAB_CLOSED,
+ registrar_.Add(this, NotificationType::TAB_CLOSED,
NotificationService::AllSources());
- registrar_.Add(this, NOTIFY_NAV_LIST_PRUNED,
+ registrar_.Add(this, NotificationType::NAV_LIST_PRUNED,
NotificationService::AllSources());
- registrar_.Add(this, NOTIFY_NAV_ENTRY_CHANGED,
+ registrar_.Add(this, NotificationType::NAV_ENTRY_CHANGED,
NotificationService::AllSources());
- registrar_.Add(this, NOTIFY_NAV_ENTRY_COMMITTED,
+ registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED,
NotificationService::AllSources());
- registrar_.Add(this, NOTIFY_BROWSER_OPENED,
+ registrar_.Add(this, NotificationType::BROWSER_OPENED,
NotificationService::AllSources());
}
@@ -384,8 +383,8 @@ void SessionService::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
// All of our messages have the NavigationController as the source.
- switch (type) {
- case NOTIFY_BROWSER_OPENED: {
+ switch (type.value) {
+ case NotificationType::BROWSER_OPENED: {
Browser* browser = Source<Browser>(source).ptr();
if (browser->profile() != profile() ||
!should_track_changes_for_browser_type(browser->type())) {
@@ -410,21 +409,21 @@ void SessionService::Observe(NotificationType type,
break;
}
- case NOTIFY_TAB_PARENTED: {
+ case NotificationType::TAB_PARENTED: {
NavigationController* controller =
Source<NavigationController>(source).ptr();
SetTabWindow(controller->window_id(), controller->session_id());
break;
}
- case NOTIFY_TAB_CLOSED: {
+ case NotificationType::TAB_CLOSED: {
NavigationController* controller =
Source<NavigationController>(source).ptr();
TabClosed(controller->window_id(), controller->session_id());
break;
}
- case NOTIFY_NAV_LIST_PRUNED: {
+ case NotificationType::NAV_LIST_PRUNED: {
NavigationController* controller =
Source<NavigationController>(source).ptr();
Details<NavigationController::PrunedDetails> pruned_details(details);
@@ -440,7 +439,7 @@ void SessionService::Observe(NotificationType type,
break;
}
- case NOTIFY_NAV_ENTRY_CHANGED: {
+ case NotificationType::NAV_ENTRY_CHANGED: {
NavigationController* controller =
Source<NavigationController>(source).ptr();
Details<NavigationController::EntryChangedDetails> changed(details);
@@ -449,7 +448,7 @@ void SessionService::Observe(NotificationType type,
break;
}
- case NOTIFY_NAV_ENTRY_COMMITTED: {
+ case NotificationType::NAV_ENTRY_COMMITTED: {
NavigationController* controller =
Source<NavigationController>(source).ptr();
int current_entry_index = controller->GetCurrentEntryIndex();