Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 24 matching lines...) Expand all Loading... | |
| 35 void SetNewOwner(PrintJobWorkerOwner* new_owner); | 35 void SetNewOwner(PrintJobWorkerOwner* new_owner); |
| 36 | 36 |
| 37 // Initializes the print settings. If |ask_user_for_settings| is true, a | 37 // Initializes the print settings. If |ask_user_for_settings| is true, a |
| 38 // Print... dialog box will be shown to ask the user his preference. | 38 // Print... dialog box will be shown to ask the user his preference. |
| 39 void GetSettings(bool ask_user_for_settings, | 39 void GetSettings(bool ask_user_for_settings, |
| 40 gfx::NativeView parent_view, | 40 gfx::NativeView parent_view, |
| 41 int document_page_count, | 41 int document_page_count, |
| 42 bool has_selection, | 42 bool has_selection, |
| 43 bool use_overlays); | 43 bool use_overlays); |
| 44 | 44 |
| 45 // Set the new print settings. |new_settings| is a json string. | |
| 46 void SetSettings(const std::string& new_settings); | |
| 47 | |
| 45 // Starts the printing loop. Every pages are printed as soon as the data is | 48 // Starts the printing loop. Every pages are printed as soon as the data is |
| 46 // available. Makes sure the new_document is the right one. | 49 // available. Makes sure the new_document is the right one. |
| 47 void StartPrinting(PrintedDocument* new_document); | 50 void StartPrinting(PrintedDocument* new_document); |
| 48 | 51 |
| 49 // Updates the printed document. | 52 // Updates the printed document. |
| 50 void OnDocumentChanged(PrintedDocument* new_document); | 53 void OnDocumentChanged(PrintedDocument* new_document); |
| 51 | 54 |
| 52 // Unqueues waiting pages. Called when PrintJob receives a | 55 // Unqueues waiting pages. Called when PrintJob receives a |
| 53 // NOTIFY_PRINTED_DOCUMENT_UPDATED notification. It's time to look again if | 56 // NOTIFY_PRINTED_DOCUMENT_UPDATED notification. It's time to look again if |
| 54 // the next page can be printed. | 57 // the next page can be printed. |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 85 // but sticks with this for consistency. | 88 // but sticks with this for consistency. |
| 86 void GetSettingsWithUI(gfx::NativeView parent_view, | 89 void GetSettingsWithUI(gfx::NativeView parent_view, |
| 87 int document_page_count, | 90 int document_page_count, |
| 88 bool has_selection); | 91 bool has_selection); |
| 89 | 92 |
| 90 // The callback used by PrintingContext::GetSettingsWithUI() to notify this | 93 // The callback used by PrintingContext::GetSettingsWithUI() to notify this |
| 91 // 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 |
| 92 // back into the IO thread for GetSettingsDone(). | 95 // back into the IO thread for GetSettingsDone(). |
| 93 void GetSettingsWithUIDone(PrintingContext::Result result); | 96 void GetSettingsWithUIDone(PrintingContext::Result result); |
| 94 | 97 |
| 98 // Called on a UI thread to update the print settings. | |
|
James Hawkins
2011/02/16 22:58:21
s/a/the/
kmadhusu
2011/02/17 19:20:31
Done.
| |
| 99 void UpdatePrintSettings(const std::string& new_settings); | |
| 100 | |
| 95 // Reports settings back to owner_. | 101 // Reports settings back to owner_. |
| 96 void GetSettingsDone(PrintingContext::Result result); | 102 void GetSettingsDone(PrintingContext::Result result); |
| 97 | 103 |
| 98 // Use the default settings. When using GTK+ or Mac, this can still end up | 104 // Use the default settings. When using GTK+ or Mac, this can still end up |
| 99 // displaying a dialog. So this needs to happen from the UI thread on these | 105 // displaying a dialog. So this needs to happen from the UI thread on these |
| 100 // systems. | 106 // systems. |
| 101 void UseDefaultSettings(); | 107 void UseDefaultSettings(); |
| 102 | 108 |
| 103 // Information about the printer setting. | 109 // Information about the printer setting. |
| 104 scoped_ptr<PrintingContext> printing_context_; | 110 scoped_ptr<PrintingContext> printing_context_; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 120 | 126 |
| 121 template <> | 127 template <> |
| 122 struct RunnableMethodTraits<printing::PrintJobWorker> { | 128 struct RunnableMethodTraits<printing::PrintJobWorker> { |
| 123 void RetainCallee(printing::PrintJobWorker* obj); | 129 void RetainCallee(printing::PrintJobWorker* obj); |
| 124 void ReleaseCallee(printing::PrintJobWorker* obj); | 130 void ReleaseCallee(printing::PrintJobWorker* obj); |
| 125 private: | 131 private: |
| 126 scoped_refptr<printing::PrintJobWorkerOwner> owner_; | 132 scoped_refptr<printing::PrintJobWorkerOwner> owner_; |
| 127 }; | 133 }; |
| 128 | 134 |
| 129 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ | 135 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ |
| OLD | NEW |