OLD | NEW |
---|---|
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(content::WebUI* webui, | |
Dan Beam
2016/01/27 00:23:57
web_ui
dpapad
2016/01/27 00:45:24
Removed.
| |
32 const base::Value& callbackId, | |
Dan Beam
2016/01/27 00:23:57
callback_id
dpapad
2016/01/27 00:45:23
Done.
| |
33 const base::Value& response); | |
Dan Beam
2016/01/27 00:23:57
\n
dpapad
2016/01/27 00:45:24
Done.
| |
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_ |
OLD | NEW |