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 <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/callback.h" | 11 #include "base/callback.h" |
11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class DictionaryValue; | 16 class DictionaryValue; |
17 class ListValue; | 17 class ListValue; |
18 class RefCountedMemory; | 18 class RefCountedMemory; |
19 } | 19 } |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 class BrowserContext; | 22 class BrowserContext; |
(...skipping 13 matching lines...) Expand all Loading... |
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 using GetPrinterInfoCallback = | 42 using GetPrinterInfoCallback = |
43 base::Callback<void(const base::DictionaryValue& printer_info)>; | 43 base::Callback<void(const base::DictionaryValue& printer_info)>; |
44 | 44 |
45 // Creates an instance of an PrinterHandler for extension printers. | 45 // Creates an instance of an PrinterHandler for extension printers. |
46 static scoped_ptr<PrinterHandler> CreateForExtensionPrinters( | 46 static std::unique_ptr<PrinterHandler> CreateForExtensionPrinters( |
47 content::BrowserContext* browser_context); | 47 content::BrowserContext* browser_context); |
48 | 48 |
49 virtual ~PrinterHandler() {} | 49 virtual ~PrinterHandler() {} |
50 | 50 |
51 // Cancels all pending requests. | 51 // Cancels all pending requests. |
52 virtual void Reset() = 0; | 52 virtual void Reset() = 0; |
53 | 53 |
54 // Starts getting available printers. | 54 // Starts getting available printers. |
55 // |callback| should be called in the response to the request. | 55 // |callback| should be called in the response to the request. |
56 virtual void StartGetPrinters(const GetPrintersCallback& callback) = 0; | 56 virtual void StartGetPrinters(const GetPrintersCallback& callback) = 0; |
(...skipping 25 matching lines...) Expand all Loading... |
82 const std::string& destination_id, | 82 const std::string& destination_id, |
83 const std::string& capability, | 83 const std::string& capability, |
84 const base::string16& job_title, | 84 const base::string16& job_title, |
85 const std::string& ticket_json, | 85 const std::string& ticket_json, |
86 const gfx::Size& page_size, | 86 const gfx::Size& page_size, |
87 const scoped_refptr<base::RefCountedMemory>& print_data, | 87 const scoped_refptr<base::RefCountedMemory>& print_data, |
88 const PrintCallback& callback) = 0; | 88 const PrintCallback& callback) = 0; |
89 }; | 89 }; |
90 | 90 |
91 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINTER_HANDLER_H_ | 91 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINTER_HANDLER_H_ |
OLD | NEW |