| 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_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 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 PrintJobWorker(int render_process_id, | 35 PrintJobWorker(int render_process_id, |
| 36 int render_view_id, | 36 int render_view_id, |
| 37 PrintJobWorkerOwner* owner); | 37 PrintJobWorkerOwner* owner); |
| 38 virtual ~PrintJobWorker(); | 38 virtual ~PrintJobWorker(); |
| 39 | 39 |
| 40 void SetNewOwner(PrintJobWorkerOwner* new_owner); | 40 void SetNewOwner(PrintJobWorkerOwner* new_owner); |
| 41 | 41 |
| 42 // Initializes the print settings. If |ask_user_for_settings| is true, a | 42 // Initializes the print settings. If |ask_user_for_settings| is true, a |
| 43 // Print... dialog box will be shown to ask the user his preference. | 43 // Print... dialog box will be shown to ask the user his preference. |
| 44 void GetSettings( | 44 void GetSettings( |
| 45 bool ask_user_for_settings, | 45 GetSettingsAskParam ask_user_for_settings, |
| 46 int document_page_count, | 46 int document_page_count, |
| 47 bool has_selection, | 47 bool has_selection, |
| 48 MarginType margin_type); | 48 MarginType margin_type); |
| 49 | 49 |
| 50 // Set the new print settings. | 50 // Set the new print settings. |
| 51 void SetSettings(scoped_ptr<base::DictionaryValue> new_settings); | 51 void SetSettings(scoped_ptr<base::DictionaryValue> new_settings); |
| 52 | 52 |
| 53 // Starts the printing loop. Every pages are printed as soon as the data is | 53 // Starts the printing loop. Every pages are printed as soon as the data is |
| 54 // available. Makes sure the new_document is the right one. | 54 // available. Makes sure the new_document is the right one. |
| 55 void StartPrinting(PrintedDocument* new_document); | 55 void StartPrinting(PrintedDocument* new_document); |
| 56 | 56 |
| 57 // TODO DGN Doc |
| 58 void ShowSystemDialog(); |
| 59 |
| 57 // Updates the printed document. | 60 // Updates the printed document. |
| 58 void OnDocumentChanged(PrintedDocument* new_document); | 61 void OnDocumentChanged(PrintedDocument* new_document); |
| 59 | 62 |
| 60 // Dequeues waiting pages. Called when PrintJob receives a | 63 // Dequeues waiting pages. Called when PrintJob receives a |
| 61 // NOTIFY_PRINTED_DOCUMENT_UPDATED notification. It's time to look again if | 64 // NOTIFY_PRINTED_DOCUMENT_UPDATED notification. It's time to look again if |
| 62 // the next page can be printed. | 65 // the next page can be printed. |
| 63 void OnNewPage(); | 66 void OnNewPage(); |
| 64 | 67 |
| 65 // This is the only function that can be called in a thread. | 68 // This is the only function that can be called in a thread. |
| 66 void Cancel(); | 69 void Cancel(); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 153 |
| 151 // Used to generate a WeakPtr for callbacks. | 154 // Used to generate a WeakPtr for callbacks. |
| 152 base::WeakPtrFactory<PrintJobWorker> weak_factory_; | 155 base::WeakPtrFactory<PrintJobWorker> weak_factory_; |
| 153 | 156 |
| 154 DISALLOW_COPY_AND_ASSIGN(PrintJobWorker); | 157 DISALLOW_COPY_AND_ASSIGN(PrintJobWorker); |
| 155 }; | 158 }; |
| 156 | 159 |
| 157 } // namespace printing | 160 } // namespace printing |
| 158 | 161 |
| 159 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ | 162 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ |
| OLD | NEW |