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

Unified Diff: chrome/browser/sync/glue/session_change_processor.cc

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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
Index: chrome/browser/sync/glue/session_change_processor.cc
===================================================================
--- chrome/browser/sync/glue/session_change_processor.cc (revision 91968)
+++ chrome/browser/sync/glue/session_change_processor.cc (working copy)
@@ -16,6 +16,7 @@
#include "chrome/browser/sync/glue/session_model_associator.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/tab_contents/navigation_controller.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/notification_details.h"
@@ -53,7 +54,7 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
-void SessionChangeProcessor::Observe(NotificationType type,
+void SessionChangeProcessor::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -63,8 +64,8 @@
// Track which windows and/or tabs are modified.
std::vector<TabContentsWrapper*> modified_tabs;
bool windows_changed = false;
- switch (type.value) {
- case NotificationType::BROWSER_OPENED: {
+ switch (type) {
+ case chrome::NOTIFICATION_BROWSER_OPENED: {
Browser* browser = Source<Browser>(source).ptr();
if (browser->profile() != profile_) {
return;
@@ -74,7 +75,7 @@
break;
}
- case NotificationType::TAB_PARENTED: {
+ case content::NOTIFICATION_TAB_PARENTED: {
TabContentsWrapper* tab = Source<TabContentsWrapper>(source).ptr();
if (tab->profile() != profile_) {
return;
@@ -84,7 +85,7 @@
break;
}
- case NotificationType::TAB_CLOSED: {
+ case content::NOTIFICATION_TAB_CLOSED: {
TabContentsWrapper* tab =
TabContentsWrapper::GetCurrentWrapperForContents(
Source<NavigationController>(source).ptr()->tab_contents());
@@ -96,7 +97,7 @@
break;
}
- case NotificationType::NAV_LIST_PRUNED: {
+ case content::NOTIFICATION_NAV_LIST_PRUNED: {
TabContentsWrapper* tab =
TabContentsWrapper::GetCurrentWrapperForContents(
Source<NavigationController>(source).ptr()->tab_contents());
@@ -107,7 +108,7 @@
break;
}
- case NotificationType::NAV_ENTRY_CHANGED: {
+ case content::NOTIFICATION_NAV_ENTRY_CHANGED: {
TabContentsWrapper* tab =
TabContentsWrapper::GetCurrentWrapperForContents(
Source<NavigationController>(source).ptr()->tab_contents());
@@ -118,7 +119,7 @@
break;
}
- case NotificationType::NAV_ENTRY_COMMITTED: {
+ case content::NOTIFICATION_NAV_ENTRY_COMMITTED: {
TabContentsWrapper* tab =
TabContentsWrapper::GetCurrentWrapperForContents(
Source<NavigationController>(source).ptr()->tab_contents());
@@ -129,7 +130,7 @@
break;
}
- case NotificationType::TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED: {
+ case chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED: {
ExtensionTabHelper* extension_tab_helper =
Source<ExtensionTabHelper>(source).ptr();
if (extension_tab_helper->tab_contents()->profile() != profile_) {
@@ -142,7 +143,7 @@
}
default:
LOG(ERROR) << "Received unexpected notification of type "
- << type.value;
+ << type;
break;
}
@@ -220,7 +221,7 @@
// Notify foreign session handlers that there are new sessions.
NotificationService::current()->Notify(
- NotificationType::FOREIGN_SESSION_UPDATED,
+ chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED,
NotificationService::AllSources(),
NotificationService::NoDetails());
@@ -244,20 +245,20 @@
void SessionChangeProcessor::StartObserving() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(profile_);
- notification_registrar_.Add(this, NotificationType::TAB_PARENTED,
+ notification_registrar_.Add(this, content::NOTIFICATION_TAB_PARENTED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::TAB_CLOSED,
+ notification_registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::NAV_LIST_PRUNED,
+ notification_registrar_.Add(this, content::NOTIFICATION_NAV_LIST_PRUNED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::NAV_ENTRY_CHANGED,
+ notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_CHANGED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED,
+ notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::BROWSER_OPENED,
+ notification_registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED,
NotificationService::AllSources());
notification_registrar_.Add(this,
- NotificationType::TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED,
+ chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED,
NotificationService::AllSources());
}
« no previous file with comments | « chrome/browser/sync/glue/session_change_processor.h ('k') | chrome/browser/sync/glue/session_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698