| 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 <unordered_set> | 8 #include <unordered_set> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
| 13 #include "content/public/browser/web_ui_controller.h" | 13 #include "content/public/browser/web_ui_controller.h" |
| 14 | 14 |
| 15 class GURL; | 15 class GURL; |
| 16 | 16 |
| 17 namespace user_prefs { |
| 18 class PrefRegistrySyncable; |
| 19 } |
| 20 |
| 17 namespace settings { | 21 namespace settings { |
| 18 | 22 |
| 19 class SettingsPageUIHandler; | 23 class SettingsPageUIHandler; |
| 20 | 24 |
| 21 // The WebUI handler for chrome://md-settings. | 25 // The WebUI handler for chrome://md-settings. |
| 22 class MdSettingsUI : public content::WebUIController, | 26 class MdSettingsUI : public content::WebUIController, |
| 23 public content::WebContentsObserver { | 27 public content::WebContentsObserver { |
| 24 public: | 28 public: |
| 29 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 30 |
| 25 MdSettingsUI(content::WebUI* web_ui, const GURL& url); | 31 MdSettingsUI(content::WebUI* web_ui, const GURL& url); |
| 26 ~MdSettingsUI() override; | 32 ~MdSettingsUI() override; |
| 27 | 33 |
| 28 // content::WebContentsObserver: | 34 // content::WebContentsObserver: |
| 29 void DidStartNavigation( | 35 void DidStartNavigation( |
| 30 content::NavigationHandle* navigation_handle) override; | 36 content::NavigationHandle* navigation_handle) override; |
| 31 void DocumentLoadedInFrame( | 37 void DocumentLoadedInFrame( |
| 32 content::RenderFrameHost *render_frame_host) override; | 38 content::RenderFrameHost *render_frame_host) override; |
| 33 void DocumentOnLoadCompletedInMainFrame() override; | 39 void DocumentOnLoadCompletedInMainFrame() override; |
| 34 | 40 |
| 35 private: | 41 private: |
| 36 void AddSettingsPageUIHandler(std::unique_ptr<SettingsPageUIHandler> handler); | 42 void AddSettingsPageUIHandler(std::unique_ptr<SettingsPageUIHandler> handler); |
| 37 | 43 |
| 38 // Weak references; all |handlers_| are owned by |web_ui()|. | 44 // Weak references; all |handlers_| are owned by |web_ui()|. |
| 39 std::unordered_set<SettingsPageUIHandler*> handlers_; | 45 std::unordered_set<SettingsPageUIHandler*> handlers_; |
| 40 | 46 |
| 41 base::Time load_start_time_; | 47 base::Time load_start_time_; |
| 42 | 48 |
| 43 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI); | 49 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI); |
| 44 }; | 50 }; |
| 45 | 51 |
| 46 } // namespace settings | 52 } // namespace settings |
| 47 | 53 |
| 48 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ | 54 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ |
| OLD | NEW |