| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // Starts getting all local privet printers. |args| is unused. | 126 // Starts getting all local privet printers. |args| is unused. |
| 127 void HandleGetPrivetPrinters(const base::ListValue* args); | 127 void HandleGetPrivetPrinters(const base::ListValue* args); |
| 128 | 128 |
| 129 // Starts getting all local extension managed printers. |args| is unused. | 129 // Starts getting all local extension managed printers. |args| is unused. |
| 130 void HandleGetExtensionPrinters(const base::ListValue* args); | 130 void HandleGetExtensionPrinters(const base::ListValue* args); |
| 131 | 131 |
| 132 // Starts getting all local USB printers supported by extensions. |args| is | 132 // Starts getting all local USB printers supported by extensions. |args| is |
| 133 // unused. | 133 // unused. |
| 134 void HandleGetExtensionUsbPrinters(const base::ListValue* args); | 134 void HandleGetExtensionUsbPrinters(const base::ListValue* args); |
| 135 | 135 |
| 136 // Grants an extension access to a USB printer. First element of |args| is |
| 137 // the extension ID and the second element is USB device ID. |
| 138 void HandleGrantExtensionUsbPrinterAccess(const base::ListValue* args); |
| 139 |
| 136 // Stops getting all local privet printers. |arg| is unused. | 140 // Stops getting all local privet printers. |arg| is unused. |
| 137 void HandleStopGetPrivetPrinters(const base::ListValue* args); | 141 void HandleStopGetPrivetPrinters(const base::ListValue* args); |
| 138 | 142 |
| 139 // Asks the initiator renderer to generate a preview. First element of |args| | 143 // Asks the initiator renderer to generate a preview. First element of |args| |
| 140 // is a job settings JSON string. | 144 // is a job settings JSON string. |
| 141 void HandleGetPreview(const base::ListValue* args); | 145 void HandleGetPreview(const base::ListValue* args); |
| 142 | 146 |
| 143 // Gets the job settings from Web UI and initiate printing. First element of | 147 // Gets the job settings from Web UI and initiate printing. First element of |
| 144 // |args| is a job settings JSON string. | 148 // |args| is a job settings JSON string. |
| 145 void HandlePrint(const base::ListValue* args); | 149 void HandlePrint(const base::ListValue* args); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 // Called when a list of printers is reported by an extension. | 314 // Called when a list of printers is reported by an extension. |
| 311 // |printers|: The list of printers managed by the extension. | 315 // |printers|: The list of printers managed by the extension. |
| 312 // |done|: Whether all the extensions have reported the list of printers | 316 // |done|: Whether all the extensions have reported the list of printers |
| 313 // they manage. | 317 // they manage. |
| 314 void OnGotPrintersForExtension(const base::ListValue& printers, bool done); | 318 void OnGotPrintersForExtension(const base::ListValue& printers, bool done); |
| 315 | 319 |
| 316 // Called with the list of USB printers supported by extensions. | 320 // Called with the list of USB printers supported by extensions. |
| 317 // |printers|: The list of printers supported by extensions. | 321 // |printers|: The list of printers supported by extensions. |
| 318 void OnGotExtensionUsbPrinters(const base::ListValue& printers); | 322 void OnGotExtensionUsbPrinters(const base::ListValue& printers); |
| 319 | 323 |
| 324 // Called when an extension reports information for a USB printer it has just |
| 325 // been granted access to. |
| 326 // |extension_id|: The extension that was queried. |
| 327 // |device_id|: The id of the USB device. |
| 328 // |printer_info|: The data reported by the extension. |
| 329 void OnGotExtensionUsbPrinterInfo(const std::string& extension_id, |
| 330 int device_id, |
| 331 const base::DictionaryValue& printer_info); |
| 332 |
| 320 // Called when an extension reports the set of print capabilites for a | 333 // Called when an extension reports the set of print capabilites for a |
| 321 // printer. | 334 // printer. |
| 322 // |printer_id|: The id of the printer whose capabilities are reported. | 335 // |printer_id|: The id of the printer whose capabilities are reported. |
| 323 // |capabilities|: The printer capabilities. | 336 // |capabilities|: The printer capabilities. |
| 324 void OnGotExtensionPrinterCapabilities( | 337 void OnGotExtensionPrinterCapabilities( |
| 325 const std::string& printer_id, | 338 const std::string& printer_id, |
| 326 const base::DictionaryValue& capabilities); | 339 const base::DictionaryValue& capabilities); |
| 327 | 340 |
| 328 // Called when an extension print job is completed. | 341 // Called when an extension print job is completed. |
| 329 // |success|: Whether the job succeeded. | 342 // |success|: Whether the job succeeded. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 // Notifies tests that want to know if the PDF has been saved. This doesn't | 399 // Notifies tests that want to know if the PDF has been saved. This doesn't |
| 387 // notify the test if it was a successful save, only that it was attempted. | 400 // notify the test if it was a successful save, only that it was attempted. |
| 388 base::Closure pdf_file_saved_closure_; | 401 base::Closure pdf_file_saved_closure_; |
| 389 | 402 |
| 390 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; | 403 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; |
| 391 | 404 |
| 392 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 405 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
| 393 }; | 406 }; |
| 394 | 407 |
| 395 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ | 408 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ |
| OLD | NEW |