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

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: update javascript structures 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 void HandleGetPrinterInfo(const base::ListValue* args);
Carlson 2017/05/31 16:58:52 Function comment
skau 2017/06/01 21:50:29 Done.
53
52 void HandleAddCupsPrinter(const base::ListValue* args); 54 void HandleAddCupsPrinter(const base::ListValue* args);
53 void OnAddedPrinter(std::unique_ptr<Printer> printer, 55 void OnAddedPrinter(std::unique_ptr<Printer> printer,
54 chromeos::PrinterSetupResult result); 56 chromeos::PrinterSetupResult result);
55 void OnAddPrinterError(); 57 void OnAddPrinterError();
56 58
57 // Get a list of all manufacturers for which we have at least one model of 59 // 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. 60 // printer supported. Takes one argument, the callback id for the result.
59 // The callback will be invoked with {success: <boolean>, models: 61 // The callback will be invoked with {success: <boolean>, models:
60 // <Array<string>>}. 62 // <Array<string>>}.
61 void HandleGetCupsPrinterManufacturers(const base::ListValue* args); 63 void HandleGetCupsPrinterManufacturers(const base::ListValue* args);
(...skipping 30 matching lines...) Expand all
92 94
93 // Invokes debugd to add the printer to CUPS. If |ipp_everywhere| is true, 95 // Invokes debugd to add the printer to CUPS. If |ipp_everywhere| is true,
94 // automatic configuration will be attempted and |ppd_path| is ignored. 96 // automatic configuration will be attempted and |ppd_path| is ignored.
95 // |ppd_path| is the path to a Postscript Printer Description file that will 97 // |ppd_path| is the path to a Postscript Printer Description file that will
96 // be used to configure the printer capabilities. This file must be in 98 // be used to configure the printer capabilities. This file must be in
97 // Downloads or the PPD Cache. 99 // Downloads or the PPD Cache.
98 void AddPrinterToCups(std::unique_ptr<Printer> printer, 100 void AddPrinterToCups(std::unique_ptr<Printer> printer,
99 const base::FilePath& ppd_path, 101 const base::FilePath& ppd_path,
100 bool ipp_everywhere); 102 bool ipp_everywhere);
101 103
104 void OnPrinterInfo(const std::string& callback_id,
Carlson 2017/05/31 16:58:52 Function comment please. When is this called, wha
skau 2017/06/01 21:50:29 Done.
105 bool success,
106 const std::string& make,
107 const std::string& model,
108 bool ipp_everywhere);
109
102 std::unique_ptr<chromeos::PrinterDiscoverer> printer_discoverer_; 110 std::unique_ptr<chromeos::PrinterDiscoverer> printer_discoverer_;
103 scoped_refptr<chromeos::printing::PpdProvider> ppd_provider_; 111 scoped_refptr<chromeos::printing::PpdProvider> ppd_provider_;
104 std::unique_ptr<chromeos::PrinterConfigurer> printer_configurer_; 112 std::unique_ptr<chromeos::PrinterConfigurer> printer_configurer_;
105 113
106 Profile* profile_; 114 Profile* profile_;
107 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; 115 scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
108 std::string webui_callback_id_; 116 std::string webui_callback_id_;
109 117
110 base::WeakPtrFactory<CupsPrintersHandler> weak_factory_; 118 base::WeakPtrFactory<CupsPrintersHandler> weak_factory_;
111 119
112 DISALLOW_COPY_AND_ASSIGN(CupsPrintersHandler); 120 DISALLOW_COPY_AND_ASSIGN(CupsPrintersHandler);
113 }; 121 };
114 122
115 } // namespace settings 123 } // namespace settings
116 } // namespace chromeos 124 } // namespace chromeos
117 125
118 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_ 126 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698