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

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

Issue 1635673003: MD Settings: Add helper method for responding to cr.sendWithPromise. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments. Created 4 years, 10 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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_SETTINGS_MD_SETTINGS_UI_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "content/public/browser/web_ui_controller.h" 14 #include "content/public/browser/web_ui_controller.h"
15 #include "content/public/browser/web_ui_message_handler.h" 15 #include "content/public/browser/web_ui_message_handler.h"
16 16
17 namespace settings { 17 namespace settings {
18 18
19 // The base class handler of Javascript messages of settings pages. 19 // The base class handler of Javascript messages of settings pages.
20 class SettingsPageUIHandler : public content::WebUIMessageHandler { 20 class SettingsPageUIHandler : public content::WebUIMessageHandler {
21 public: 21 public:
22 SettingsPageUIHandler(); 22 SettingsPageUIHandler();
23 ~SettingsPageUIHandler() override; 23 ~SettingsPageUIHandler() override;
24 24
25 // WebUIMessageHandler implementation. 25 // WebUIMessageHandler implementation.
26 void RegisterMessages() override {} 26 void RegisterMessages() override {}
27 27
28 protected:
29 // Helper method for responding to JS requests initiated with
30 // cr.sendWithPromise().
31 void CallJavascriptCallback(const base::Value& callback_id,
32 const base::Value& response);
33
28 private: 34 private:
29 DISALLOW_COPY_AND_ASSIGN(SettingsPageUIHandler); 35 DISALLOW_COPY_AND_ASSIGN(SettingsPageUIHandler);
30 }; 36 };
31 37
32 // The WebUI handler for chrome://md-settings. 38 // The WebUI handler for chrome://md-settings.
33 class MdSettingsUI : public content::WebUIController { 39 class MdSettingsUI : public content::WebUIController {
34 public: 40 public:
35 explicit MdSettingsUI(content::WebUI* web_ui); 41 explicit MdSettingsUI(content::WebUI* web_ui);
36 ~MdSettingsUI() override; 42 ~MdSettingsUI() override;
37 43
38 private: 44 private:
39 void AddSettingsPageUIHandler(content::WebUIMessageHandler* handler); 45 void AddSettingsPageUIHandler(content::WebUIMessageHandler* handler);
40 46
41 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI); 47 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI);
42 }; 48 };
43 49
44 } // namespace settings 50 } // namespace settings
45 51
46 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ 52 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/appearance_handler.cc ('k') | chrome/browser/ui/webui/settings/md_settings_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698