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

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

Issue 2250843002: [CUPS] WebUI handler for CUPS printing: Retrieve the printer list from user preference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address skau@'s comments. Created 4 years, 4 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 "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" 9 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
10 10
11 namespace base { 11 namespace base {
12 class ListValue; 12 class ListValue;
13 } // namespace base 13 } // namespace base
14 14
15 class Profile;
16
15 namespace chromeos { 17 namespace chromeos {
16 namespace settings { 18 namespace settings {
17 19
18 // Chrome OS CUPS printing settings page UI handler. 20 // Chrome OS CUPS printing settings page UI handler.
19 class CupsPrintersHandler : public ::settings::SettingsPageUIHandler { 21 class CupsPrintersHandler : public ::settings::SettingsPageUIHandler {
20 public: 22 public:
21 CupsPrintersHandler(); 23 explicit CupsPrintersHandler(content::WebUI* webui);
22 ~CupsPrintersHandler() override; 24 ~CupsPrintersHandler() override;
23 25
24 // SettingsPageUIHandler overrides: 26 // SettingsPageUIHandler overrides:
25 void RegisterMessages() override; 27 void RegisterMessages() override;
26 void OnJavascriptAllowed() override{}; 28 void OnJavascriptAllowed() override{};
27 void OnJavascriptDisallowed() override{}; 29 void OnJavascriptDisallowed() override{};
28 30
29 private: 31 private:
30 // Gets all CUPS printers and return it to WebUI. 32 // Gets all CUPS printers and return it to WebUI.
31 void HandleGetCupsPrintersList(const base::ListValue* args); 33 void HandleGetCupsPrintersList(const base::ListValue* args);
32 void OnGetCupsPrintersList(const std::string callback_id,
33 base::ListValue* printers_list);
34 34
35 void HandleUpdateCupsPrinter(const base::ListValue* args); 35 void HandleUpdateCupsPrinter(const base::ListValue* args);
36 void HandleRemoveCupsPrinter(const base::ListValue* args); 36 void HandleRemoveCupsPrinter(const base::ListValue* args);
37 37
38 Profile* profile_;
38 base::WeakPtrFactory<CupsPrintersHandler> weak_factory_; 39 base::WeakPtrFactory<CupsPrintersHandler> weak_factory_;
39 40
40 DISALLOW_COPY_AND_ASSIGN(CupsPrintersHandler); 41 DISALLOW_COPY_AND_ASSIGN(CupsPrintersHandler);
41 }; 42 };
42 43
43 } // namespace settings 44 } // namespace settings
44 } // namespace chromeos 45 } // namespace chromeos
45 46
46 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_ 47 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698