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

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

Issue 2652323002: Convert MdSettingsUI to use the new navigation callbacks. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/md_settings_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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 settings { 17 namespace settings {
18 18
19 class SettingsPageUIHandler; 19 class SettingsPageUIHandler;
20 20
21 // The WebUI handler for chrome://md-settings. 21 // The WebUI handler for chrome://md-settings.
22 class MdSettingsUI : public content::WebUIController, 22 class MdSettingsUI : public content::WebUIController,
23 public content::WebContentsObserver { 23 public content::WebContentsObserver {
24 public: 24 public:
25 MdSettingsUI(content::WebUI* web_ui, const GURL& url); 25 MdSettingsUI(content::WebUI* web_ui, const GURL& url);
26 ~MdSettingsUI() override; 26 ~MdSettingsUI() override;
27 27
28 // content::WebContentsObserver: 28 // content::WebContentsObserver:
29 void DidStartProvisionalLoadForFrame( 29 void DidStartNavigation(
30 content::RenderFrameHost* render_frame_host, 30 content::NavigationHandle* navigation_handle) override;
31 const GURL& validated_url,
32 bool is_error_page) override;
33 void DocumentLoadedInFrame( 31 void DocumentLoadedInFrame(
34 content::RenderFrameHost *render_frame_host) override; 32 content::RenderFrameHost *render_frame_host) override;
35 void DocumentOnLoadCompletedInMainFrame() override; 33 void DocumentOnLoadCompletedInMainFrame() override;
36 34
37 private: 35 private:
38 void AddSettingsPageUIHandler(std::unique_ptr<SettingsPageUIHandler> handler); 36 void AddSettingsPageUIHandler(std::unique_ptr<SettingsPageUIHandler> handler);
39 37
40 // Weak references; all |handlers_| are owned by |web_ui()|. 38 // Weak references; all |handlers_| are owned by |web_ui()|.
41 std::unordered_set<SettingsPageUIHandler*> handlers_; 39 std::unordered_set<SettingsPageUIHandler*> handlers_;
42 40
43 base::Time load_start_time_; 41 base::Time load_start_time_;
44 42
45 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI); 43 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI);
46 }; 44 };
47 45
48 } // namespace settings 46 } // namespace settings
49 47
50 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ 48 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/md_settings_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698