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; |
| 16 |
15 namespace settings { | 17 namespace settings { |
16 | 18 |
17 class SettingsPageUIHandler; | 19 class SettingsPageUIHandler; |
18 | 20 |
19 // The WebUI handler for chrome://md-settings. | 21 // The WebUI handler for chrome://md-settings. |
20 class MdSettingsUI : public content::WebUIController, | 22 class MdSettingsUI : public content::WebUIController, |
21 public content::WebContentsObserver { | 23 public content::WebContentsObserver { |
22 public: | 24 public: |
23 explicit MdSettingsUI(content::WebUI* web_ui); | 25 MdSettingsUI(content::WebUI* web_ui, const GURL& url); |
24 ~MdSettingsUI() override; | 26 ~MdSettingsUI() override; |
25 | 27 |
26 // content::WebContentsObserver: | 28 // content::WebContentsObserver: |
27 void DidStartProvisionalLoadForFrame( | 29 void DidStartProvisionalLoadForFrame( |
28 content::RenderFrameHost* render_frame_host, | 30 content::RenderFrameHost* render_frame_host, |
29 const GURL& validated_url, | 31 const GURL& validated_url, |
30 bool is_error_page, | 32 bool is_error_page, |
31 bool is_iframe_srcdoc) override; | 33 bool is_iframe_srcdoc) override; |
32 void DocumentLoadedInFrame( | 34 void DocumentLoadedInFrame( |
33 content::RenderFrameHost *render_frame_host) override; | 35 content::RenderFrameHost *render_frame_host) override; |
34 void DocumentOnLoadCompletedInMainFrame() override; | 36 void DocumentOnLoadCompletedInMainFrame() override; |
35 | 37 |
36 private: | 38 private: |
37 void AddSettingsPageUIHandler(SettingsPageUIHandler* handler); | 39 void AddSettingsPageUIHandler(SettingsPageUIHandler* handler); |
38 | 40 |
39 // Weak references; all |handlers_| are owned by |web_ui()|. | 41 // Weak references; all |handlers_| are owned by |web_ui()|. |
40 std::unordered_set<SettingsPageUIHandler*> handlers_; | 42 std::unordered_set<SettingsPageUIHandler*> handlers_; |
41 | 43 |
42 base::Time load_start_time_; | 44 base::Time load_start_time_; |
43 | 45 |
44 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI); | 46 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI); |
45 }; | 47 }; |
46 | 48 |
47 } // namespace settings | 49 } // namespace settings |
48 | 50 |
49 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ | 51 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ |
OLD | NEW |