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

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

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 | « chrome/browser/ui/webui/settings/md_settings_ui.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "chrome/browser/ui/webui/settings/md_settings_ui.h" 5 #include "chrome/browser/ui/webui/settings/md_settings_ui.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 20 matching lines...) Expand all
31 #include "chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler. h" 31 #include "chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler. h"
32 #include "chrome/browser/ui/webui/settings/settings_cookies_view_handler.h" 32 #include "chrome/browser/ui/webui/settings/settings_cookies_view_handler.h"
33 #include "chrome/browser/ui/webui/settings/settings_import_data_handler.h" 33 #include "chrome/browser/ui/webui/settings/settings_import_data_handler.h"
34 #include "chrome/browser/ui/webui/settings/settings_media_devices_selection_hand ler.h" 34 #include "chrome/browser/ui/webui/settings/settings_media_devices_selection_hand ler.h"
35 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" 35 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
36 #include "chrome/browser/ui/webui/settings/settings_startup_pages_handler.h" 36 #include "chrome/browser/ui/webui/settings/settings_startup_pages_handler.h"
37 #include "chrome/browser/ui/webui/settings/site_settings_handler.h" 37 #include "chrome/browser/ui/webui/settings/site_settings_handler.h"
38 #include "chrome/common/url_constants.h" 38 #include "chrome/common/url_constants.h"
39 #include "chrome/grit/settings_resources.h" 39 #include "chrome/grit/settings_resources.h"
40 #include "chrome/grit/settings_resources_map.h" 40 #include "chrome/grit/settings_resources_map.h"
41 #include "content/public/browser/navigation_handle.h"
41 #include "content/public/browser/web_contents.h" 42 #include "content/public/browser/web_contents.h"
42 #include "content/public/browser/web_ui.h" 43 #include "content/public/browser/web_ui.h"
43 #include "content/public/browser/web_ui_data_source.h" 44 #include "content/public/browser/web_ui_data_source.h"
44 45
45 #if defined(OS_CHROMEOS) 46 #if defined(OS_CHROMEOS)
46 #include "ash/common/system/chromeos/palette/palette_utils.h" 47 #include "ash/common/system/chromeos/palette/palette_utils.h"
47 #include "ash/common/system/chromeos/power/power_status.h" 48 #include "ash/common/system/chromeos/power/power_status.h"
48 #include "chrome/browser/chromeos/arc/arc_session_manager.h" 49 #include "chrome/browser/chromeos/arc/arc_session_manager.h"
49 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" 50 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
50 #include "chrome/browser/ui/ash/ash_util.h" 51 #include "chrome/browser/ui/ash/ash_util.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 MdSettingsUI::~MdSettingsUI() { 196 MdSettingsUI::~MdSettingsUI() {
196 } 197 }
197 198
198 void MdSettingsUI::AddSettingsPageUIHandler( 199 void MdSettingsUI::AddSettingsPageUIHandler(
199 std::unique_ptr<SettingsPageUIHandler> handler) { 200 std::unique_ptr<SettingsPageUIHandler> handler) {
200 DCHECK(handler); 201 DCHECK(handler);
201 handlers_.insert(handler.get()); 202 handlers_.insert(handler.get());
202 web_ui()->AddMessageHandler(std::move(handler)); 203 web_ui()->AddMessageHandler(std::move(handler));
203 } 204 }
204 205
205 void MdSettingsUI::DidStartProvisionalLoadForFrame( 206 void MdSettingsUI::DidStartNavigation(
206 content::RenderFrameHost* render_frame_host, 207 content::NavigationHandle* navigation_handle) {
207 const GURL& validated_url, 208 if (navigation_handle->IsSamePage())
208 bool is_error_page) { 209 return;
210
209 load_start_time_ = base::Time::Now(); 211 load_start_time_ = base::Time::Now();
210 } 212 }
211 213
212 void MdSettingsUI::DocumentLoadedInFrame( 214 void MdSettingsUI::DocumentLoadedInFrame(
213 content::RenderFrameHost* render_frame_host) { 215 content::RenderFrameHost* render_frame_host) {
214 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", 216 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD",
215 base::Time::Now() - load_start_time_); 217 base::Time::Now() - load_start_time_);
216 } 218 }
217 219
218 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { 220 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() {
219 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", 221 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD",
220 base::Time::Now() - load_start_time_); 222 base::Time::Now() - load_start_time_);
221 } 223 }
222 224
223 } // namespace settings 225 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698