| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // Renders a page in the printer. | 76 // Renders a page in the printer. |
| 77 void SpoolPage(PrintedPage& page); | 77 void SpoolPage(PrintedPage& page); |
| 78 | 78 |
| 79 // Closes the job since spooling is done. | 79 // Closes the job since spooling is done. |
| 80 void OnDocumentDone(); | 80 void OnDocumentDone(); |
| 81 | 81 |
| 82 // Discards the current document, the current page and cancels the printing | 82 // Discards the current document, the current page and cancels the printing |
| 83 // context. | 83 // context. |
| 84 void OnFailure(); | 84 void OnFailure(); |
| 85 | 85 |
| 86 #if defined(OS_MACOSX) || defined(USE_X11) | 86 #if defined(OS_POSIX) |
| 87 // Asks the user for print settings. Must be called on the UI thread. | 87 // Asks the user for print settings. Must be called on the UI thread. |
| 88 // Mac and Linux-only since Windows can display UI from non-main threads. | 88 // Mac and Linux-only since Windows can display UI from non-main threads. |
| 89 void GetSettingsWithUI(gfx::NativeView parent_view, | 89 void GetSettingsWithUI(gfx::NativeView parent_view, |
| 90 int document_page_count, | 90 int document_page_count, |
| 91 bool has_selection); | 91 bool has_selection); |
| 92 | 92 |
| 93 // The callback used by PrintingContext::GetSettingsWithUI() to notify this | 93 // The callback used by PrintingContext::GetSettingsWithUI() to notify this |
| 94 // object that the print settings are set. This is needed in order to bounce | 94 // object that the print settings are set. This is needed in order to bounce |
| 95 // back into the IO thread for GetSettingsDone(). | 95 // back into the IO thread for GetSettingsDone(). |
| 96 void GetSettingsWithUIDone(PrintingContext::Result result); | 96 void GetSettingsWithUIDone(PrintingContext::Result result); |
| 97 #endif | 97 #endif // defined(OS_POSIX) |
| 98 | 98 |
| 99 // Reports settings back to owner_. | 99 // Reports settings back to owner_. |
| 100 void GetSettingsDone(PrintingContext::Result result); | 100 void GetSettingsDone(PrintingContext::Result result); |
| 101 | 101 |
| 102 // Use the default settings. When using GTK+ or Mac, this can still end up | 102 // Use the default settings. When using GTK+ or Mac, this can still end up |
| 103 // displaying a dialog. So this needs to happen from the UI thread on these | 103 // displaying a dialog. So this needs to happen from the UI thread on these |
| 104 // systems. | 104 // systems. |
| 105 void UseDefaultSettings(); | 105 void UseDefaultSettings(); |
| 106 | 106 |
| 107 // Information about the printer setting. | 107 // Information about the printer setting. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 124 | 124 |
| 125 template <> | 125 template <> |
| 126 struct RunnableMethodTraits<printing::PrintJobWorker> { | 126 struct RunnableMethodTraits<printing::PrintJobWorker> { |
| 127 void RetainCallee(printing::PrintJobWorker* obj); | 127 void RetainCallee(printing::PrintJobWorker* obj); |
| 128 void ReleaseCallee(printing::PrintJobWorker* obj); | 128 void ReleaseCallee(printing::PrintJobWorker* obj); |
| 129 private: | 129 private: |
| 130 scoped_refptr<printing::PrintJobWorkerOwner> owner_; | 130 scoped_refptr<printing::PrintJobWorkerOwner> owner_; |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ | 133 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ |
| OLD | NEW |