Chromium Code Reviews| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 static bool PrivetPrintingEnabled(); | 117 static bool PrivetPrintingEnabled(); |
| 118 | 118 |
| 119 content::WebContents* preview_web_contents() const; | 119 content::WebContents* preview_web_contents() const; |
| 120 | 120 |
| 121 // Gets the list of printers. |args| is unused. | 121 // Gets the list of printers. |args| is unused. |
| 122 void HandleGetPrinters(const base::ListValue* args); | 122 void HandleGetPrinters(const base::ListValue* args); |
| 123 | 123 |
| 124 // Starts getting all local privet printers. |arg| is unused. | 124 // Starts getting all local privet printers. |arg| is unused. |
| 125 void HandleGetPrivetPrinters(const base::ListValue* args); | 125 void HandleGetPrivetPrinters(const base::ListValue* args); |
| 126 | 126 |
| 127 // Starts getting all local extension managed printers. |arg| is unused. | |
| 128 void HandleGetExtensionPrinters(const base::ListValue* args); | |
| 129 | |
| 127 // Stops getting all local privet printers. |arg| is unused. | 130 // Stops getting all local privet printers. |arg| is unused. |
| 128 void HandleStopGetPrivetPrinters(const base::ListValue* args); | 131 void HandleStopGetPrivetPrinters(const base::ListValue* args); |
| 129 | 132 |
| 130 // Asks the initiator renderer to generate a preview. First element of |args| | 133 // Asks the initiator renderer to generate a preview. First element of |args| |
| 131 // is a job settings JSON string. | 134 // is a job settings JSON string. |
| 132 void HandleGetPreview(const base::ListValue* args); | 135 void HandleGetPreview(const base::ListValue* args); |
| 133 | 136 |
| 134 // Gets the job settings from Web UI and initiate printing. First element of | 137 // Gets the job settings from Web UI and initiate printing. First element of |
| 135 // |args| is a job settings JSON string. | 138 // |args| is a job settings JSON string. |
| 136 void HandlePrint(const base::ListValue* args); | 139 void HandlePrint(const base::ListValue* args); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 // URL to set the new tab to. | 192 // URL to set the new tab to. |
| 190 // | 193 // |
| 191 // NOTE: This is needed to open FedEx confirmation window as a new tab. | 194 // NOTE: This is needed to open FedEx confirmation window as a new tab. |
| 192 // Javascript's "window.open" opens a new window popup (since initiated from | 195 // Javascript's "window.open" opens a new window popup (since initiated from |
| 193 // async HTTP request) and worse yet, on Windows and Chrome OS, the opened | 196 // async HTTP request) and worse yet, on Windows and Chrome OS, the opened |
| 194 // window opens behind the initiator window. | 197 // window opens behind the initiator window. |
| 195 void HandleForceOpenNewTab(const base::ListValue* args); | 198 void HandleForceOpenNewTab(const base::ListValue* args); |
| 196 | 199 |
| 197 void HandleGetPrivetPrinterCapabilities(const base::ListValue* arg); | 200 void HandleGetPrivetPrinterCapabilities(const base::ListValue* arg); |
| 198 | 201 |
| 202 // Requests an extension managed printer's capabilities. | |
| 203 // |arg| contains the ID of the extension from which the capabilities are | |
| 204 // requested and the ID of the printer whose capabilities are requested. | |
| 205 void HandleGetExtensionPrinterCapabilities(const base::ListValue* args); | |
| 206 | |
| 199 void SendInitialSettings(const std::string& default_printer); | 207 void SendInitialSettings(const std::string& default_printer); |
| 200 | 208 |
| 201 // Send OAuth2 access token. | 209 // Send OAuth2 access token. |
| 202 void SendAccessToken(const std::string& type, | 210 void SendAccessToken(const std::string& type, |
| 203 const std::string& access_token); | 211 const std::string& access_token); |
| 204 | 212 |
| 205 // Sends the printer capabilities to the Web UI. |settings_info| contains | 213 // Sends the printer capabilities to the Web UI. |settings_info| contains |
| 206 // printer capabilities information. | 214 // printer capabilities information. |
| 207 void SendPrinterCapabilities(const base::DictionaryValue* settings_info); | 215 void SendPrinterCapabilities(const base::DictionaryValue* settings_info); |
| 208 | 216 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 const std::string& name, | 283 const std::string& name, |
| 276 const local_discovery::PrivetHTTPAsynchronousFactory::ResultCallback& | 284 const local_discovery::PrivetHTTPAsynchronousFactory::ResultCallback& |
| 277 callback); | 285 callback); |
| 278 void FillPrinterDescription( | 286 void FillPrinterDescription( |
| 279 const std::string& name, | 287 const std::string& name, |
| 280 const local_discovery::DeviceDescription& description, | 288 const local_discovery::DeviceDescription& description, |
| 281 bool has_local_printing, | 289 bool has_local_printing, |
| 282 base::DictionaryValue* printer_value); | 290 base::DictionaryValue* printer_value); |
| 283 #endif | 291 #endif |
| 284 | 292 |
| 293 // Called when a list of printers is reported by an extension. | |
| 294 // |printers|: The list of printers managed by the extension. | |
| 295 // |done|: Whether all the extensions have reported the list of printers | |
| 296 // they manage. | |
| 297 void OnGotPrintersForExtension(const base::ListValue& printers, bool done); | |
| 298 | |
| 299 // Called when an extension reports the set of print capabilites for a | |
| 300 // printer. | |
| 301 // |extension_id|: The extension that manages the printer. | |
| 302 // |printer_id|: The id of the pritner whose capabilities are reported. | |
| 303 // |capabilities|: The printer capabilities. | |
| 304 void OnGotExtensionPrinterCapabilities( | |
| 305 const std::string& extension_id, | |
|
Vitaly Buka (NO REVIEWS)
2015/02/03 16:55:48
why do we need to have separate extension id and p
| |
| 306 const std::string& printer_id, | |
| 307 const base::DictionaryValue& capabilities); | |
| 308 | |
| 285 // Register/unregister from notifications of changes done to the GAIA | 309 // Register/unregister from notifications of changes done to the GAIA |
| 286 // cookie. | 310 // cookie. |
| 287 void RegisterForMergeSession(); | 311 void RegisterForMergeSession(); |
| 288 void UnregisterForMergeSession(); | 312 void UnregisterForMergeSession(); |
| 289 | 313 |
| 290 // The underlying dialog object. | 314 // The underlying dialog object. |
| 291 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; | 315 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; |
| 292 | 316 |
| 293 // A count of how many requests received to regenerate preview data. | 317 // A count of how many requests received to regenerate preview data. |
| 294 // Initialized to 0 then incremented and emitted to a histogram. | 318 // Initialized to 0 then incremented and emitted to a histogram. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 333 // Notifies tests that want to know if the PDF has been saved. This doesn't | 357 // Notifies tests that want to know if the PDF has been saved. This doesn't |
| 334 // notify the test if it was a successful save, only that it was attempted. | 358 // notify the test if it was a successful save, only that it was attempted. |
| 335 base::Closure pdf_file_saved_closure_; | 359 base::Closure pdf_file_saved_closure_; |
| 336 | 360 |
| 337 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; | 361 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; |
| 338 | 362 |
| 339 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 363 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
| 340 }; | 364 }; |
| 341 | 365 |
| 342 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 366 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
| OLD | NEW |