| 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 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class SettingsPageUIHandler : public content::WebUIMessageHandler { | 22 class SettingsPageUIHandler : public content::WebUIMessageHandler { |
| 23 public: | 23 public: |
| 24 SettingsPageUIHandler(); | 24 SettingsPageUIHandler(); |
| 25 ~SettingsPageUIHandler() override; | 25 ~SettingsPageUIHandler() override; |
| 26 | 26 |
| 27 // WebUIMessageHandler implementation. | 27 // WebUIMessageHandler implementation. |
| 28 void RegisterMessages() override {} | 28 void RegisterMessages() override {} |
| 29 | 29 |
| 30 protected: | 30 protected: |
| 31 // Helper method for responding to JS requests initiated with | 31 // Helper method for responding to JS requests initiated with |
| 32 // cr.sendWithPromise(). | 32 // cr.sendWithPromise(). |is_success| indicates whether the promise will be |
| 33 // resolved or rejected. |
| 33 void CallJavascriptCallback(const base::Value& callback_id, | 34 void CallJavascriptCallback(const base::Value& callback_id, |
| 35 bool is_success, |
| 34 const base::Value& response); | 36 const base::Value& response); |
| 35 | 37 |
| 36 private: | 38 private: |
| 37 DISALLOW_COPY_AND_ASSIGN(SettingsPageUIHandler); | 39 DISALLOW_COPY_AND_ASSIGN(SettingsPageUIHandler); |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 // The WebUI handler for chrome://md-settings. | 42 // The WebUI handler for chrome://md-settings. |
| 41 class MdSettingsUI : public content::WebUIController, | 43 class MdSettingsUI : public content::WebUIController, |
| 42 public content::WebContentsObserver { | 44 public content::WebContentsObserver { |
| 43 public: | 45 public: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 58 void AddSettingsPageUIHandler(content::WebUIMessageHandler* handler); | 60 void AddSettingsPageUIHandler(content::WebUIMessageHandler* handler); |
| 59 | 61 |
| 60 base::Time load_start_time_; | 62 base::Time load_start_time_; |
| 61 | 63 |
| 62 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI); | 64 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI); |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 } // namespace settings | 67 } // namespace settings |
| 66 | 68 |
| 67 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ | 69 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ |
| OLD | NEW |