OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PRINTER_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINTER_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINTER_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINTER_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 class PrinterHandler { | 33 class PrinterHandler { |
34 public: | 34 public: |
35 using GetPrintersCallback = | 35 using GetPrintersCallback = |
36 base::Callback<void(const base::ListValue& printers, bool done)>; | 36 base::Callback<void(const base::ListValue& printers, bool done)>; |
37 using GetCapabilityCallback = | 37 using GetCapabilityCallback = |
38 base::Callback<void(const std::string& printer_id, | 38 base::Callback<void(const std::string& printer_id, |
39 const base::DictionaryValue& capability)>; | 39 const base::DictionaryValue& capability)>; |
40 using PrintCallback = | 40 using PrintCallback = |
41 base::Callback<void(bool success, const std::string& error)>; | 41 base::Callback<void(bool success, const std::string& error)>; |
42 | 42 |
43 // Creates an instance of an PrinterHandler for extension printers. | |
44 static scoped_ptr<PrinterHandler> CreateForExtensionPrinters( | |
45 content::BrowserContext* browser_context); | |
46 | |
47 virtual ~PrinterHandler() {} | 43 virtual ~PrinterHandler() {} |
48 | 44 |
49 // Cancels all pending requests. | 45 // Cancels all pending requests. |
50 virtual void Reset() = 0; | 46 virtual void Reset() = 0; |
51 | 47 |
52 // Starts getting available printers. | 48 // Starts getting available printers. |
53 // |callback| should be called in the response to the request. | 49 // |callback| should be called in the response to the request. |
54 virtual void StartGetPrinters(const GetPrintersCallback& callback) = 0; | 50 virtual void StartGetPrinters(const GetPrintersCallback& callback) = 0; |
55 | 51 |
56 // Starts getting printing capability of the printer with the provided | 52 // Starts getting printing capability of the printer with the provided |
(...skipping 15 matching lines...) Expand all Loading... |
72 const std::string& destination_id, | 68 const std::string& destination_id, |
73 const std::string& capability, | 69 const std::string& capability, |
74 const base::string16& job_title, | 70 const base::string16& job_title, |
75 const std::string& ticket_json, | 71 const std::string& ticket_json, |
76 const gfx::Size& page_size, | 72 const gfx::Size& page_size, |
77 const scoped_refptr<base::RefCountedMemory>& print_data, | 73 const scoped_refptr<base::RefCountedMemory>& print_data, |
78 const PrintCallback& callback) = 0; | 74 const PrintCallback& callback) = 0; |
79 }; | 75 }; |
80 | 76 |
81 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINTER_HANDLER_H_ | 77 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINTER_HANDLER_H_ |
OLD | NEW |