summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing/print_job_manager.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/printing/print_job_manager.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/printing/print_job_manager.cc')
-rw-r--r--chrome/browser/printing/print_job_manager.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/printing/print_job_manager.cc b/chrome/browser/printing/print_job_manager.cc
index 978f889..c2ff3a8 100644
--- a/chrome/browser/printing/print_job_manager.cc
+++ b/chrome/browser/printing/print_job_manager.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/printing/printed_document.h"
#include "chrome/browser/printing/printed_page.h"
#include "chrome/common/gfx/emf.h"
+#include "chrome/common/notification_service.h"
namespace printing {
@@ -18,11 +19,11 @@ PrintJobManager::PrintJobManager()
: debug_dump_path_() {
NotificationService::current()->AddObserver(
this,
- NOTIFY_PRINT_JOB_EVENT,
+ NotificationType::PRINT_JOB_EVENT,
NotificationService::AllSources());
NotificationService::current()->AddObserver(
this,
- NOTIFY_PRINTED_DOCUMENT_UPDATED,
+ NotificationType::PRINTED_DOCUMENT_UPDATED,
NotificationService::AllSources());
}
@@ -33,11 +34,11 @@ PrintJobManager::~PrintJobManager() {
queued_queries_.clear();
NotificationService::current()->RemoveObserver(
this,
- NOTIFY_PRINT_JOB_EVENT,
+ NotificationType::PRINT_JOB_EVENT,
NotificationService::AllSources());
NotificationService::current()->RemoveObserver(
this,
- NOTIFY_PRINTED_DOCUMENT_UPDATED,
+ NotificationType::PRINTED_DOCUMENT_UPDATED,
NotificationService::AllSources());
}
@@ -61,11 +62,11 @@ void PrintJobManager::OnQuit() {
current_jobs_.clear();
NotificationService::current()->RemoveObserver(
this,
- NOTIFY_PRINT_JOB_EVENT,
+ NotificationType::PRINT_JOB_EVENT,
NotificationService::AllSources());
NotificationService::current()->RemoveObserver(
this,
- NOTIFY_PRINTED_DOCUMENT_UPDATED,
+ NotificationType::PRINTED_DOCUMENT_UPDATED,
NotificationService::AllSources());
DCHECK_EQ(current_jobs_.size(), 0);
}
@@ -98,13 +99,13 @@ void PrintJobManager::PopPrinterQuery(int document_cookie,
void PrintJobManager::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type) {
- case NOTIFY_PRINT_JOB_EVENT: {
+ switch (type.value) {
+ case NotificationType::PRINT_JOB_EVENT: {
OnPrintJobEvent(Source<PrintJob>(source).ptr(),
*Details<JobEventDetails>(details).ptr());
break;
}
- case NOTIFY_PRINTED_DOCUMENT_UPDATED: {
+ case NotificationType::PRINTED_DOCUMENT_UPDATED: {
PrintedPage* printed_page = Details<PrintedPage>(details).ptr();
if (printed_page)
OnPrintedDocumentUpdated(*Source<PrintedDocument>(source).ptr(),