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

Side by Side Diff: chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h

Issue 2915703002: Query printers for autoconf info during setup. (Closed)
Patch Set: close the right dialog 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 void RegisterMessages() override; 42 void RegisterMessages() override;
43 void OnJavascriptAllowed() override {} 43 void OnJavascriptAllowed() override {}
44 void OnJavascriptDisallowed() override {} 44 void OnJavascriptDisallowed() override {}
45 45
46 private: 46 private:
47 // Gets all CUPS printers and return it to WebUI. 47 // Gets all CUPS printers and return it to WebUI.
48 void HandleGetCupsPrintersList(const base::ListValue* args); 48 void HandleGetCupsPrintersList(const base::ListValue* args);
49 void HandleUpdateCupsPrinter(const base::ListValue* args); 49 void HandleUpdateCupsPrinter(const base::ListValue* args);
50 void HandleRemoveCupsPrinter(const base::ListValue* args); 50 void HandleRemoveCupsPrinter(const base::ListValue* args);
51 51
52 // For a CupsPrinterInfo in |args|, retrieves the relevant PrinterInfo object
53 // using an IPP call to the printer.
54 void HandleGetPrinterInfo(const base::ListValue* args);
55
56 // Handles the callback for HandleGetPrinterInfo. |callback_id| is the
stevenjb 2017/06/08 15:58:28 nit: We generally avoid using two spaces between s
skau 2017/06/08 22:11:26 Done.
57 // identifier to resolve the correct Promise. |success| indicates if the
58 // query was successful. |make| is the detected printer manufacturer.
59 // |model| is the detected model. |ipp_everywhere| indicates if configuration
60 // using the CUPS IPP Everywhere driver should be attempted. If |success| is
61 // false, the values of |make|, |model| and |ipp_everywhere| are not
62 // specified.
63 void OnPrinterInfo(const std::string& callback_id,
64 bool success,
65 const std::string& make,
66 const std::string& model,
67 bool ipp_everywhere);
68
52 void HandleAddCupsPrinter(const base::ListValue* args); 69 void HandleAddCupsPrinter(const base::ListValue* args);
53 void OnAddedPrinter(std::unique_ptr<Printer> printer, 70 void OnAddedPrinter(std::unique_ptr<Printer> printer,
54 chromeos::PrinterSetupResult result); 71 chromeos::PrinterSetupResult result);
55 void OnAddPrinterError(); 72 void OnAddPrinterError();
56 73
57 // Get a list of all manufacturers for which we have at least one model of 74 // Get a list of all manufacturers for which we have at least one model of
58 // printer supported. Takes one argument, the callback id for the result. 75 // printer supported. Takes one argument, the callback id for the result.
59 // The callback will be invoked with {success: <boolean>, models: 76 // The callback will be invoked with {success: <boolean>, models:
60 // <Array<string>>}. 77 // <Array<string>>}.
61 void HandleGetCupsPrinterManufacturers(const base::ListValue* args); 78 void HandleGetCupsPrinterManufacturers(const base::ListValue* args);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 126
110 base::WeakPtrFactory<CupsPrintersHandler> weak_factory_; 127 base::WeakPtrFactory<CupsPrintersHandler> weak_factory_;
111 128
112 DISALLOW_COPY_AND_ASSIGN(CupsPrintersHandler); 129 DISALLOW_COPY_AND_ASSIGN(CupsPrintersHandler);
113 }; 130 };
114 131
115 } // namespace settings 132 } // namespace settings
116 } // namespace chromeos 133 } // namespace chromeos
117 134
118 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_ 135 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698