From bfd04a62ce610d7bb61dbb78811dccbed23589b7 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Sun, 1 Feb 2009 18:16:56 +0000 Subject: 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 --- chrome/browser/printing/print_job_manager.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'chrome/browser/printing/print_job_manager.cc') 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(source).ptr(), *Details(details).ptr()); break; } - case NOTIFY_PRINTED_DOCUMENT_UPDATED: { + case NotificationType::PRINTED_DOCUMENT_UPDATED: { PrintedPage* printed_page = Details(details).ptr(); if (printed_page) OnPrintedDocumentUpdated(*Source(source).ptr(), -- cgit v1.1