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

Unified Diff: chrome/browser/sessions/session_restore.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
« no previous file with comments | « chrome/browser/sessions/restore_tab_helper.cc ('k') | chrome/browser/sessions/session_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_restore.cc
===================================================================
--- chrome/browser/sessions/session_restore.cc (revision 91968)
+++ chrome/browser/sessions/session_restore.cc (working copy)
@@ -26,6 +26,7 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_window.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/browser/renderer_host/render_widget_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/browser/tab_contents/navigation_controller.h"
@@ -85,7 +86,7 @@
// NotificationObserver method. Removes the specified tab and loads the next
// tab.
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
@@ -177,7 +178,7 @@
}
void TabLoader::StartLoading() {
- registrar_.Add(this, NotificationType::RENDER_WIDGET_HOST_DID_PAINT,
+ registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT,
NotificationService::AllSources());
#if defined(OS_CHROMEOS)
if (chromeos::NetworkStateNotifier::is_connected()) {
@@ -185,7 +186,7 @@
LoadNextTab();
} else {
// Start listening to network state notification now.
- registrar_.Add(this, NotificationType::NETWORK_STATE_CHANGED,
+ registrar_.Add(this, chrome::NETWORK_STATE_CHANGED,
NotificationService::AllSources());
}
#else
@@ -227,12 +228,12 @@
}
}
-void TabLoader::Observe(NotificationType type,
+void TabLoader::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
+ switch (type) {
#if defined(OS_CHROMEOS)
- case NotificationType::NETWORK_STATE_CHANGED: {
+ case chrome::NETWORK_STATE_CHANGED: {
chromeos::NetworkStateDetails* state_details =
Details<chromeos::NetworkStateDetails>(details).ptr();
switch (state_details->state()) {
@@ -256,7 +257,7 @@
break;
}
#endif
- case NotificationType::LOAD_START: {
+ case content::NOTIFICATION_LOAD_START: {
// Add this render_widget_host to the set of those we're waiting for
// paints on. We want to only record stats for paints that occur after
// a load has finished.
@@ -266,7 +267,7 @@
render_widget_hosts_loading_.insert(render_widget_host);
break;
}
- case NotificationType::TAB_CONTENTS_DESTROYED: {
+ case content::NOTIFICATION_TAB_CONTENTS_DESTROYED: {
TabContents* tab_contents = Source<TabContents>(source).ptr();
if (!got_first_paint_) {
RenderWidgetHost* render_widget_host =
@@ -276,13 +277,13 @@
HandleTabClosedOrLoaded(&tab_contents->controller());
break;
}
- case NotificationType::LOAD_STOP: {
+ case content::NOTIFICATION_LOAD_STOP: {
NavigationController* tab = Source<NavigationController>(source).ptr();
render_widget_hosts_to_paint_.insert(GetRenderWidgetHost(tab));
HandleTabClosedOrLoaded(tab);
break;
}
- case NotificationType::RENDER_WIDGET_HOST_DID_PAINT: {
+ case content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT: {
if (!got_first_paint_) {
RenderWidgetHost* render_widget_host =
Source<RenderWidgetHost>(source).ptr();
@@ -323,7 +324,7 @@
break;
}
default:
- NOTREACHED() << "Unknown notification received:" << type.value;
+ NOTREACHED() << "Unknown notification received:" << type;
}
// Delete ourselves when we're not waiting for any more notifications.
if ((got_first_paint_ || render_widget_hosts_to_paint_.empty()) &&
@@ -332,11 +333,11 @@
}
void TabLoader::RemoveTab(NavigationController* tab) {
- registrar_.Remove(this, NotificationType::TAB_CONTENTS_DESTROYED,
+ registrar_.Remove(this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
Source<TabContents>(tab->tab_contents()));
- registrar_.Remove(this, NotificationType::LOAD_STOP,
+ registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP,
Source<NavigationController>(tab));
- registrar_.Remove(this, NotificationType::LOAD_START,
+ registrar_.Remove(this, content::NOTIFICATION_LOAD_START,
Source<NavigationController>(tab));
TabsLoading::iterator i = tabs_loading_.find(tab);
@@ -366,11 +367,11 @@
}
void TabLoader::RegisterForNotifications(NavigationController* controller) {
- registrar_.Add(this, NotificationType::TAB_CONTENTS_DESTROYED,
+ registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
Source<TabContents>(controller->tab_contents()));
- registrar_.Add(this, NotificationType::LOAD_STOP,
+ registrar_.Add(this, content::NOTIFICATION_LOAD_STOP,
Source<NavigationController>(controller));
- registrar_.Add(this, NotificationType::LOAD_START,
+ registrar_.Add(this, content::NOTIFICATION_LOAD_START,
Source<NavigationController>(controller));
++tab_count_;
}
@@ -447,7 +448,7 @@
}
if (browser_) {
- registrar_.Add(this, NotificationType::BROWSER_CLOSED,
+ registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED,
Source<Browser>(browser_));
}
@@ -499,11 +500,11 @@
g_browser_process->ReleaseModule();
}
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::BROWSER_CLOSED:
+ switch (type) {
+ case chrome::NOTIFICATION_BROWSER_CLOSED:
delete this;
return;
« no previous file with comments | « chrome/browser/sessions/restore_tab_helper.cc ('k') | chrome/browser/sessions/session_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698