| 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 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 void OnNotifyPrintJobEvent(const JobEventDetails& event_details); | 118 void OnNotifyPrintJobEvent(const JobEventDetails& event_details); |
| 119 | 119 |
| 120 // Releases the worker thread by calling Stop(), then broadcasts a JOB_DONE | 120 // Releases the worker thread by calling Stop(), then broadcasts a JOB_DONE |
| 121 // notification. | 121 // notification. |
| 122 void OnDocumentDone(); | 122 void OnDocumentDone(); |
| 123 | 123 |
| 124 // Terminates the worker thread in a very controlled way, to work around any | 124 // Terminates the worker thread in a very controlled way, to work around any |
| 125 // eventual deadlock. | 125 // eventual deadlock. |
| 126 void ControlledWorkerShutdown(); | 126 void ControlledWorkerShutdown(); |
| 127 | 127 |
| 128 // Called at shutdown when running a nested message loop. | 128 // Called at shutdown when running a nested run loop. |
| 129 void Quit(); | 129 void Quit(); |
| 130 | 130 |
| 131 void HoldUntilStopIsCalled(); | 131 void HoldUntilStopIsCalled(); |
| 132 | 132 |
| 133 #if defined(OS_WIN) | 133 #if defined(OS_WIN) |
| 134 void OnPdfConversionStarted(int page_count); | 134 void OnPdfConversionStarted(int page_count); |
| 135 void OnPdfPageConverted(int page_number, | 135 void OnPdfPageConverted(int page_number, |
| 136 float scale_factor, | 136 float scale_factor, |
| 137 std::unique_ptr<MetafilePlayer> metafile); | 137 std::unique_ptr<MetafilePlayer> metafile); |
| 138 #endif // defined(OS_WIN) | 138 #endif // defined(OS_WIN) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 160 // Is Canceling? If so, try to not cause recursion if on FAILED notification, | 160 // Is Canceling? If so, try to not cause recursion if on FAILED notification, |
| 161 // the notified calls Cancel() again. | 161 // the notified calls Cancel() again. |
| 162 bool is_canceling_; | 162 bool is_canceling_; |
| 163 | 163 |
| 164 #if defined(OS_WIN) | 164 #if defined(OS_WIN) |
| 165 class PdfConversionState; | 165 class PdfConversionState; |
| 166 std::unique_ptr<PdfConversionState> pdf_conversion_state_; | 166 std::unique_ptr<PdfConversionState> pdf_conversion_state_; |
| 167 std::vector<int> pdf_page_mapping_; | 167 std::vector<int> pdf_page_mapping_; |
| 168 #endif // defined(OS_WIN) | 168 #endif // defined(OS_WIN) |
| 169 | 169 |
| 170 // Used at shutdown so that we can quit a nested message loop. | 170 // Used at shutdown so that we can quit a nested run loop. |
| 171 base::WeakPtrFactory<PrintJob> quit_factory_; | 171 base::WeakPtrFactory<PrintJob> quit_factory_; |
| 172 | 172 |
| 173 DISALLOW_COPY_AND_ASSIGN(PrintJob); | 173 DISALLOW_COPY_AND_ASSIGN(PrintJob); |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 // Details for a NOTIFY_PRINT_JOB_EVENT notification. The members may be NULL. | 176 // Details for a NOTIFY_PRINT_JOB_EVENT notification. The members may be NULL. |
| 177 class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> { | 177 class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> { |
| 178 public: | 178 public: |
| 179 // Event type. | 179 // Event type. |
| 180 enum Type { | 180 enum Type { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 scoped_refptr<PrintedPage> page_; | 233 scoped_refptr<PrintedPage> page_; |
| 234 const Type type_; | 234 const Type type_; |
| 235 int job_id_; | 235 int job_id_; |
| 236 | 236 |
| 237 DISALLOW_COPY_AND_ASSIGN(JobEventDetails); | 237 DISALLOW_COPY_AND_ASSIGN(JobEventDetails); |
| 238 }; | 238 }; |
| 239 | 239 |
| 240 } // namespace printing | 240 } // namespace printing |
| 241 | 241 |
| 242 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_H_ | 242 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_H_ |
| OLD | NEW |