summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents/background_contents.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/tab_contents/background_contents.cc')
-rw-r--r--chrome/browser/tab_contents/background_contents.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/chrome/browser/tab_contents/background_contents.cc b/chrome/browser/tab_contents/background_contents.cc
index b7fa507..9d568e2 100644
--- a/chrome/browser/tab_contents/background_contents.cc
+++ b/chrome/browser/tab_contents/background_contents.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/ui/webui/chrome_web_ui_factory.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/url_constants.h"
#include "content/browser/browsing_instance.h"
@@ -31,13 +32,13 @@ BackgroundContents::BackgroundContents(SiteInstance* site_instance,
render_view_host_ = new RenderViewHost(site_instance, this, routing_id, NULL);
// Close ourselves when the application is shutting down.
- registrar_.Add(this, NotificationType::APP_TERMINATING,
+ registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING,
NotificationService::AllSources());
// Register for our parent profile to shutdown, so we can shut ourselves down
// as well (should only be called for OTR profiles, as we should receive
// APP_TERMINATING before non-OTR profiles are destroyed).
- registrar_.Add(this, NotificationType::PROFILE_DESTROYED,
+ registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
Source<Profile>(profile));
}
@@ -52,7 +53,7 @@ BackgroundContents::~BackgroundContents() {
return;
Profile* profile = render_view_host_->process()->profile();
NotificationService::current()->Notify(
- NotificationType::BACKGROUND_CONTENTS_DELETED,
+ chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED,
Source<Profile>(profile),
Details<BackgroundContents>(this));
render_view_host_->Shutdown(); // deletes render_view_host
@@ -92,7 +93,7 @@ void BackgroundContents::DidNavigate(
Profile* profile = render_view_host->process()->profile();
NotificationService::current()->Notify(
- NotificationType::BACKGROUND_CONTENTS_NAVIGATED,
+ chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED,
Source<Profile>(profile),
Details<BackgroundContents>(this));
}
@@ -120,14 +121,14 @@ bool BackgroundContents::PreHandleKeyboardEvent(
return false;
}
-void BackgroundContents::Observe(NotificationType type,
+void BackgroundContents::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
// TODO(rafaelw): Implement pagegroup ref-counting so that non-persistent
// background pages are closed when the last referencing frame is closed.
- switch (type.value) {
- case NotificationType::PROFILE_DESTROYED:
- case NotificationType::APP_TERMINATING: {
+ switch (type) {
+ case chrome::NOTIFICATION_PROFILE_DESTROYED:
+ case content::NOTIFICATION_APP_TERMINATING: {
delete this;
break;
}
@@ -164,7 +165,7 @@ void BackgroundContents::ClearInspectorSettings() {
void BackgroundContents::Close(RenderViewHost* render_view_host) {
Profile* profile = render_view_host->process()->profile();
NotificationService::current()->Notify(
- NotificationType::BACKGROUND_CONTENTS_CLOSED,
+ chrome::NOTIFICATION_BACKGROUND_CONTENTS_CLOSED,
Source<Profile>(profile),
Details<BackgroundContents>(this));
delete this;
@@ -175,7 +176,7 @@ void BackgroundContents::RenderViewGone(RenderViewHost* rvh,
int error_code) {
Profile* profile = rvh->process()->profile();
NotificationService::current()->Notify(
- NotificationType::BACKGROUND_CONTENTS_TERMINATED,
+ chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED,
Source<Profile>(profile),
Details<BackgroundContents>(this));