| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Worker thread code. All this code, except for the constructor, is executed in | 26 // Worker thread code. All this code, except for the constructor, is executed in |
| 27 // the worker thread. It manages the PrintingContext, which can be blocking | 27 // the worker thread. It manages the PrintingContext, which can be blocking |
| 28 // and/or run a message loop. This is the object that generates most | 28 // and/or run a message loop. This is the object that generates most |
| 29 // NOTIFY_PRINT_JOB_EVENT notifications, but they are generated through a | 29 // NOTIFY_PRINT_JOB_EVENT notifications, but they are generated through a |
| 30 // NotificationTask task to be executed from the right thread, the UI thread. | 30 // NotificationTask task to be executed from the right thread, the UI thread. |
| 31 // PrintJob always outlives its worker instance. | 31 // PrintJob always outlives its worker instance. |
| 32 class PrintJobWorker : public base::Thread { | 32 class PrintJobWorker : public base::Thread { |
| 33 public: | 33 public: |
| 34 explicit PrintJobWorker(PrintJobWorkerOwner* owner); | 34 explicit PrintJobWorker(PrintJobWorkerOwner* owner); |
| 35 ~PrintJobWorker(); | 35 virtual ~PrintJobWorker(); |
| 36 | 36 |
| 37 void SetNewOwner(PrintJobWorkerOwner* new_owner); | 37 void SetNewOwner(PrintJobWorkerOwner* new_owner); |
| 38 | 38 |
| 39 // Initializes the print settings. If |ask_user_for_settings| is true, a | 39 // Initializes the print settings. If |ask_user_for_settings| is true, a |
| 40 // Print... dialog box will be shown to ask the user his preference. | 40 // Print... dialog box will be shown to ask the user his preference. |
| 41 void GetSettings(bool ask_user_for_settings, | 41 void GetSettings(bool ask_user_for_settings, |
| 42 gfx::NativeView parent_view, | 42 gfx::NativeView parent_view, |
| 43 int document_page_count, | 43 int document_page_count, |
| 44 bool has_selection, | 44 bool has_selection, |
| 45 bool use_overlays); | 45 bool use_overlays); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 template <> | 131 template <> |
| 132 struct RunnableMethodTraits<printing::PrintJobWorker> { | 132 struct RunnableMethodTraits<printing::PrintJobWorker> { |
| 133 void RetainCallee(printing::PrintJobWorker* obj); | 133 void RetainCallee(printing::PrintJobWorker* obj); |
| 134 void ReleaseCallee(printing::PrintJobWorker* obj); | 134 void ReleaseCallee(printing::PrintJobWorker* obj); |
| 135 private: | 135 private: |
| 136 scoped_refptr<printing::PrintJobWorkerOwner> owner_; | 136 scoped_refptr<printing::PrintJobWorkerOwner> owner_; |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ | 139 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ |
| OLD | NEW |