| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ | 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 // The shared NotificationService service can only be accessed from the UI | 75 // The shared NotificationService service can only be accessed from the UI |
| 76 // thread, so this class encloses the necessary information to send the | 76 // thread, so this class encloses the necessary information to send the |
| 77 // notification from the right thread. Most NOTIFY_PRINT_JOB_EVENT | 77 // notification from the right thread. Most NOTIFY_PRINT_JOB_EVENT |
| 78 // notifications are sent this way, except USER_INIT_DONE, USER_INIT_CANCELED | 78 // notifications are sent this way, except USER_INIT_DONE, USER_INIT_CANCELED |
| 79 // and DEFAULT_INIT_DONE. These three are sent through PrintJob::InitDone(). | 79 // and DEFAULT_INIT_DONE. These three are sent through PrintJob::InitDone(). |
| 80 class NotificationTask; | 80 class NotificationTask; |
| 81 | 81 |
| 82 // Renders a page in the printer. | 82 // Renders a page in the printer. |
| 83 void SpoolPage(PrintedPage& page); | 83 void SpoolPage(PrintedPage* page); |
| 84 | 84 |
| 85 // Closes the job since spooling is done. | 85 // Closes the job since spooling is done. |
| 86 void OnDocumentDone(); | 86 void OnDocumentDone(); |
| 87 | 87 |
| 88 // Discards the current document, the current page and cancels the printing | 88 // Discards the current document, the current page and cancels the printing |
| 89 // context. | 89 // context. |
| 90 void OnFailure(); | 90 void OnFailure(); |
| 91 | 91 |
| 92 // Asks the user for print settings. Must be called on the UI thread. | 92 // Asks the user for print settings. Must be called on the UI thread. |
| 93 // Required on Mac and Linux. Windows can display UI from non-main threads, | 93 // Required on Mac and Linux. Windows can display UI from non-main threads, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 // Used to generate a WeakPtr for callbacks. | 129 // Used to generate a WeakPtr for callbacks. |
| 130 base::WeakPtrFactory<PrintJobWorker> weak_factory_; | 130 base::WeakPtrFactory<PrintJobWorker> weak_factory_; |
| 131 | 131 |
| 132 DISALLOW_COPY_AND_ASSIGN(PrintJobWorker); | 132 DISALLOW_COPY_AND_ASSIGN(PrintJobWorker); |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 } // namespace printing | 135 } // namespace printing |
| 136 | 136 |
| 137 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ | 137 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ |
| OLD | NEW |