Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Side by Side Diff: chrome/browser/ui/webui/print_preview/printer_handler.h

Issue 2931843003: Print Preview: Change getPrinterCapabilities to cr.sendWithPromise (Closed)
Patch Set: Address comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 17 matching lines...) Expand all
28 28
29 // Wrapper around PrinterProviderAPI to be used by print preview. 29 // Wrapper around PrinterProviderAPI to be used by print preview.
30 // It makes request lifetime management easier, and hides details of more 30 // It makes request lifetime management easier, and hides details of more
31 // complex operations like printing from the print preview handler. 31 // complex operations like printing from the print preview handler.
32 // TODO(tbarzic): Use the same interface for other printer types. 32 // TODO(tbarzic): Use the same interface for other printer types.
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 base::DictionaryValue& capability)>;
39 const base::DictionaryValue& capability)>;
40 using PrintCallback = 39 using PrintCallback =
41 base::Callback<void(bool success, const std::string& error)>; 40 base::Callback<void(bool success, const std::string& error)>;
42 using GetPrinterInfoCallback = 41 using GetPrinterInfoCallback =
43 base::Callback<void(const base::DictionaryValue& printer_info)>; 42 base::Callback<void(const base::DictionaryValue& printer_info)>;
44 43
45 // Creates an instance of an PrinterHandler for extension printers. 44 // Creates an instance of an PrinterHandler for extension printers.
46 static std::unique_ptr<PrinterHandler> CreateForExtensionPrinters( 45 static std::unique_ptr<PrinterHandler> CreateForExtensionPrinters(
47 content::BrowserContext* browser_context); 46 content::BrowserContext* browser_context);
48 47
49 virtual ~PrinterHandler() {} 48 virtual ~PrinterHandler() {}
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 const std::string& destination_id, 81 const std::string& destination_id,
83 const std::string& capability, 82 const std::string& capability,
84 const base::string16& job_title, 83 const base::string16& job_title,
85 const std::string& ticket_json, 84 const std::string& ticket_json,
86 const gfx::Size& page_size, 85 const gfx::Size& page_size,
87 const scoped_refptr<base::RefCountedMemory>& print_data, 86 const scoped_refptr<base::RefCountedMemory>& print_data,
88 const PrintCallback& callback) = 0; 87 const PrintCallback& callback) = 0;
89 }; 88 };
90 89
91 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINTER_HANDLER_H_ 90 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINTER_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698