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_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 // Called when print preview is cancelled due to a new request. | 80 // Called when print preview is cancelled due to a new request. |
81 void OnPrintPreviewCancelled(); | 81 void OnPrintPreviewCancelled(); |
82 | 82 |
83 // Called when printer settings were invalid. | 83 // Called when printer settings were invalid. |
84 void OnInvalidPrinterSettings(); | 84 void OnInvalidPrinterSettings(); |
85 | 85 |
86 // Called when print preview is ready. | 86 // Called when print preview is ready. |
87 void OnPrintPreviewReady(int preview_uid, int request_id); | 87 void OnPrintPreviewReady(int preview_uid, int request_id); |
88 | 88 |
| 89 // Send the print preset options from the document. |
| 90 void SendPrintPresetOptions(bool disable_scaling, int copies, int duplex); |
| 91 |
| 92 // Send the print preview page count and fit to page scaling |
| 93 void SendPageCountReady(int page_count, |
| 94 int request_id, |
| 95 int fit_to_page_scaling); |
| 96 |
| 97 // Send the default page layout |
| 98 void SendPageLayoutReady(const base::DictionaryValue& layout, |
| 99 bool has_custom_page_size_style); |
| 100 |
| 101 // Notify the WebUI that the page preview is ready. |
| 102 void SendPagePreviewReady(int page_index, |
| 103 int preview_uid, |
| 104 int preview_response_id); |
| 105 |
89 #if BUILDFLAG(ENABLE_BASIC_PRINTING) | 106 #if BUILDFLAG(ENABLE_BASIC_PRINTING) |
90 // Called when the user press ctrl+shift+p to display the native system | 107 // Called when the user press ctrl+shift+p to display the native system |
91 // dialog. | 108 // dialog. |
92 void ShowSystemDialog(); | 109 void ShowSystemDialog(); |
93 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) | 110 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) |
94 | 111 |
95 #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) | 112 #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) |
96 // PrivetLocalPrinterLister::Delegate implementation. | 113 // PrivetLocalPrinterLister::Delegate implementation. |
97 void LocalPrinterChanged( | 114 void LocalPrinterChanged( |
98 const std::string& name, | 115 const std::string& name, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // Performs printer setup. First element of |args| is the printer name. | 197 // Performs printer setup. First element of |args| is the printer name. |
181 void HandlePrinterSetup(const base::ListValue* args); | 198 void HandlePrinterSetup(const base::ListValue* args); |
182 | 199 |
183 #if BUILDFLAG(ENABLE_BASIC_PRINT_DIALOG) | 200 #if BUILDFLAG(ENABLE_BASIC_PRINT_DIALOG) |
184 // Asks the initiator renderer to show the native print system dialog. |args| | 201 // Asks the initiator renderer to show the native print system dialog. |args| |
185 // is unused. | 202 // is unused. |
186 void HandleShowSystemDialog(const base::ListValue* args); | 203 void HandleShowSystemDialog(const base::ListValue* args); |
187 #endif | 204 #endif |
188 | 205 |
189 // Callback for the signin dialog to call once signin is complete. | 206 // Callback for the signin dialog to call once signin is complete. |
190 void OnSigninComplete(); | 207 void OnSigninComplete(const std::string& callback_id); |
191 | 208 |
192 // Brings up a dialog to allow the user to sign into cloud print. | 209 // Brings up a dialog to allow the user to sign into cloud print. |
193 // |args| is unused. | 210 // |args| is unused. |
194 void HandleSignin(const base::ListValue* args); | 211 void HandleSignin(const base::ListValue* args); |
195 | 212 |
196 // Generates new token and sends back to UI. | 213 // Generates new token and sends back to UI. |
197 void HandleGetAccessToken(const base::ListValue* args); | 214 void HandleGetAccessToken(const base::ListValue* args); |
198 | 215 |
199 // Brings up a web page to allow the user to configure cloud print. | 216 // Brings up a web page to allow the user to configure cloud print. |
200 // |args| is unused. | 217 // |args| is unused. |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 // Proxy for calls to the print backend. Lazily initialized since web_ui() is | 468 // Proxy for calls to the print backend. Lazily initialized since web_ui() is |
452 // not available at construction time. | 469 // not available at construction time. |
453 std::unique_ptr<printing::PrinterBackendProxy> printer_backend_proxy_; | 470 std::unique_ptr<printing::PrinterBackendProxy> printer_backend_proxy_; |
454 | 471 |
455 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; | 472 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; |
456 | 473 |
457 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 474 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
458 }; | 475 }; |
459 | 476 |
460 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 477 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
OLD | NEW |