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

Unified Diff: chrome/browser/task_manager/task_manager_resource_providers.cc

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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/task_manager/task_manager_resource_providers.cc
===================================================================
--- chrome/browser/task_manager/task_manager_resource_providers.cc (revision 106380)
+++ chrome/browser/task_manager/task_manager_resource_providers.cc (working copy)
@@ -44,7 +44,7 @@
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/common/notification_service.h"
+#include "content/public/browser/notification_service.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
@@ -354,17 +354,17 @@
// Then we register for notifications to get new tabs.
registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_CONNECTED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_SWAPPED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
// TAB_CONTENTS_DISCONNECTED should be enough to know when to remove a
// resource. This is an attempt at mitigating a crasher that seem to
// indicate a resource is still referencing a deleted TabContents
// (http://crbug.com/7321).
registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
}
void TaskManagerTabContentsResourceProvider::StopUpdating() {
@@ -372,14 +372,18 @@
updating_ = false;
// Then we unregister for notifications to get new tabs.
- registrar_.Remove(this, content::NOTIFICATION_TAB_CONTENTS_CONNECTED,
- NotificationService::AllBrowserContextsAndSources());
- registrar_.Remove(this, content::NOTIFICATION_TAB_CONTENTS_SWAPPED,
- NotificationService::AllBrowserContextsAndSources());
- registrar_.Remove(this, content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED,
- NotificationService::AllBrowserContextsAndSources());
- registrar_.Remove(this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
- NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this, content::NOTIFICATION_TAB_CONTENTS_CONNECTED,
+ content::NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this, content::NOTIFICATION_TAB_CONTENTS_SWAPPED,
+ content::NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this, content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED,
+ content::NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
+ content::NotificationService::AllBrowserContextsAndSources());
// Delete all the resources.
STLDeleteContainerPairSecondPointers(resources_.begin(), resources_.end());
@@ -604,11 +608,11 @@
// Then we register for notifications to get new BackgroundContents.
registrar_.Add(this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_OPENED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
registrar_.Add(this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
registrar_.Add(this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
}
void TaskManagerBackgroundContentsResourceProvider::StopUpdating() {
@@ -616,12 +620,15 @@
updating_ = false;
// Unregister for notifications
- registrar_.Remove(this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_OPENED,
- NotificationService::AllBrowserContextsAndSources());
- registrar_.Remove(this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED,
- NotificationService::AllBrowserContextsAndSources());
- registrar_.Remove(this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED,
- NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_OPENED,
+ content::NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED,
+ content::NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED,
+ content::NotificationService::AllBrowserContextsAndSources());
// Delete all the resources.
STLDeleteContainerPairSecondPointers(resources_.begin(), resources_.end());
@@ -905,9 +912,9 @@
// Register for notifications to get new child processes.
registrar_.Add(this, content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
registrar_.Add(this, content::NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
// Get the existing child processes.
BrowserThread::PostTask(
@@ -922,11 +929,13 @@
updating_ = false;
// Unregister for notifications to get new plugin processes.
- registrar_.Remove(this, content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED,
- NotificationService::AllBrowserContextsAndSources());
- registrar_.Remove(this,
- content::NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED,
- NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this, content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED,
+ content::NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this,
+ content::NOTIFICATION_CHILD_PROCESS_HOST_DISCONNECTED,
+ content::NotificationService::AllBrowserContextsAndSources());
// Delete all the resources.
STLDeleteContainerPairSecondPointers(resources_.begin(), resources_.end());
@@ -1159,11 +1168,11 @@
// Register for notifications about extension process changes.
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_CREATED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
- NotificationService::AllBrowserContextsAndSources());
+ content::NotificationService::AllBrowserContextsAndSources());
}
void TaskManagerExtensionProcessResourceProvider::StopUpdating() {
@@ -1171,12 +1180,15 @@
updating_ = false;
// Unregister for notifications about extension process changes.
- registrar_.Remove(this, chrome::NOTIFICATION_EXTENSION_PROCESS_CREATED,
- NotificationService::AllBrowserContextsAndSources());
- registrar_.Remove(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
- NotificationService::AllBrowserContextsAndSources());
- registrar_.Remove(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
- NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this, chrome::NOTIFICATION_EXTENSION_PROCESS_CREATED,
+ content::NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
+ content::NotificationService::AllBrowserContextsAndSources());
+ registrar_.Remove(
+ this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
+ content::NotificationService::AllBrowserContextsAndSources());
// Delete all the resources.
STLDeleteContainerPairSecondPointers(resources_.begin(), resources_.end());
« no previous file with comments | « chrome/browser/task_manager/task_manager_notification_resource_provider.cc ('k') | chrome/browser/themes/theme_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698