| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/printing/print_job.h" | 5 #include "chrome/browser/printing/print_job.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 // Don't forget to register to our own messages. | 86 // Don't forget to register to our own messages. |
| 87 registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT, | 87 registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT, |
| 88 content::Source<PrintJob>(this)); | 88 content::Source<PrintJob>(this)); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void PrintJob::Observe(int type, | 91 void PrintJob::Observe(int type, |
| 92 const content::NotificationSource& source, | 92 const content::NotificationSource& source, |
| 93 const content::NotificationDetails& details) { | 93 const content::NotificationDetails& details) { |
| 94 DCHECK(RunsTasksOnCurrentThread()); | 94 DCHECK(RunsTasksOnCurrentThread()); |
| 95 switch (type) { | 95 DCHECK_EQ(chrome::NOTIFICATION_PRINT_JOB_EVENT, type); |
| 96 case chrome::NOTIFICATION_PRINT_JOB_EVENT: { | 96 |
| 97 OnNotifyPrintJobEvent(*content::Details<JobEventDetails>(details).ptr()); | 97 OnNotifyPrintJobEvent(*content::Details<JobEventDetails>(details).ptr()); |
| 98 break; | |
| 99 } | |
| 100 default: { | |
| 101 break; | |
| 102 } | |
| 103 } | |
| 104 } | 98 } |
| 105 | 99 |
| 106 void PrintJob::GetSettingsDone(const PrintSettings& new_settings, | 100 void PrintJob::GetSettingsDone(const PrintSettings& new_settings, |
| 107 PrintingContext::Result result) { | 101 PrintingContext::Result result) { |
| 108 NOTREACHED(); | 102 NOTREACHED(); |
| 109 } | 103 } |
| 110 | 104 |
| 111 PrintJobWorker* PrintJob::DetachWorker(PrintJobWorkerOwner* new_owner) { | 105 PrintJobWorker* PrintJob::DetachWorker(PrintJobWorkerOwner* new_owner) { |
| 112 NOTREACHED(); | 106 NOTREACHED(); |
| 113 return NULL; | 107 return NULL; |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 } | 449 } |
| 456 | 450 |
| 457 JobEventDetails::~JobEventDetails() { | 451 JobEventDetails::~JobEventDetails() { |
| 458 } | 452 } |
| 459 | 453 |
| 460 PrintedDocument* JobEventDetails::document() const { return document_.get(); } | 454 PrintedDocument* JobEventDetails::document() const { return document_.get(); } |
| 461 | 455 |
| 462 PrintedPage* JobEventDetails::page() const { return page_.get(); } | 456 PrintedPage* JobEventDetails::page() const { return page_.get(); } |
| 463 | 457 |
| 464 } // namespace printing | 458 } // namespace printing |
| OLD | NEW |