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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 void HandleManagePrinters(const base::ListValue* args); | 168 void HandleManagePrinters(const base::ListValue* args); |
169 | 169 |
170 // Asks the browser to show the cloud print dialog. |args| is signle int with | 170 // Asks the browser to show the cloud print dialog. |args| is signle int with |
171 // page count. | 171 // page count. |
172 void HandlePrintWithCloudPrintDialog(const base::ListValue* args); | 172 void HandlePrintWithCloudPrintDialog(const base::ListValue* args); |
173 | 173 |
174 // Asks the browser for several settings that are needed before the first | 174 // Asks the browser for several settings that are needed before the first |
175 // preview is displayed. | 175 // preview is displayed. |
176 void HandleGetInitialSettings(const base::ListValue* args); | 176 void HandleGetInitialSettings(const base::ListValue* args); |
177 | 177 |
| 178 // Asks the browser for the PDF printer capabilities, such as media size. |
| 179 void HandleGetPdfCapabilities(const base::ListValue* args); |
| 180 |
178 // Reports histogram data for a print preview UI action. |args| should consist | 181 // Reports histogram data for a print preview UI action. |args| should consist |
179 // of two elements: the bucket name, and the bucket event. | 182 // of two elements: the bucket name, and the bucket event. |
180 void HandleReportUiEvent(const base::ListValue* args); | 183 void HandleReportUiEvent(const base::ListValue* args); |
181 | 184 |
182 // Forces the opening of a new tab. |args| should consist of one element: the | 185 // Forces the opening of a new tab. |args| should consist of one element: the |
183 // URL to set the new tab to. | 186 // URL to set the new tab to. |
184 // | 187 // |
185 // NOTE: This is needed to open FedEx confirmation window as a new tab. | 188 // NOTE: This is needed to open FedEx confirmation window as a new tab. |
186 // Javascript's "window.open" opens a new window popup (since initiated from | 189 // Javascript's "window.open" opens a new window popup (since initiated from |
187 // async HTTP request) and worse yet, on Windows and Chrome OS, the opened | 190 // async HTTP request) and worse yet, on Windows and Chrome OS, the opened |
188 // window opens behind the initiator window. | 191 // window opens behind the initiator window. |
189 void HandleForceOpenNewTab(const base::ListValue* args); | 192 void HandleForceOpenNewTab(const base::ListValue* args); |
190 | 193 |
191 void HandleGetPrivetPrinterCapabilities(const base::ListValue* arg); | 194 void HandleGetPrivetPrinterCapabilities(const base::ListValue* arg); |
192 | 195 |
193 void SendInitialSettings(const std::string& default_printer); | 196 void SendInitialSettings(const std::string& default_printer); |
194 | 197 |
| 198 // Sends PDF printer capabilities to the Web UI. |
| 199 void SendPdfCapabilities(const base::DictionaryValue* capabilities); |
| 200 |
195 // Send OAuth2 access token. | 201 // Send OAuth2 access token. |
196 void SendAccessToken(const std::string& type, | 202 void SendAccessToken(const std::string& type, |
197 const std::string& access_token); | 203 const std::string& access_token); |
198 | 204 |
199 // Sends the printer capabilities to the Web UI. |settings_info| contains | 205 // Sends the printer capabilities to the Web UI. |settings_info| contains |
200 // printer capabilities information. | 206 // printer capabilities information. |
201 void SendPrinterCapabilities(const base::DictionaryValue* settings_info); | 207 void SendPrinterCapabilities(const base::DictionaryValue* settings_info); |
202 | 208 |
203 // Sends error notification to the Web UI when unable to return the printer | 209 // Sends error notification to the Web UI when unable to return the printer |
204 // capabilities. | 210 // capabilities. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 scoped_ptr<local_discovery::PrivetLocalPrintOperation> | 329 scoped_ptr<local_discovery::PrivetLocalPrintOperation> |
324 privet_local_print_operation_; | 330 privet_local_print_operation_; |
325 #endif | 331 #endif |
326 | 332 |
327 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; | 333 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; |
328 | 334 |
329 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 335 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
330 }; | 336 }; |
331 | 337 |
332 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 338 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
OLD | NEW |