| OLD | NEW |
| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 void MdSettingsUI::AddSettingsPageUIHandler( | 216 void MdSettingsUI::AddSettingsPageUIHandler( |
| 217 std::unique_ptr<SettingsPageUIHandler> handler) { | 217 std::unique_ptr<SettingsPageUIHandler> handler) { |
| 218 DCHECK(handler); | 218 DCHECK(handler); |
| 219 handlers_.insert(handler.get()); | 219 handlers_.insert(handler.get()); |
| 220 web_ui()->AddMessageHandler(std::move(handler)); | 220 web_ui()->AddMessageHandler(std::move(handler)); |
| 221 } | 221 } |
| 222 | 222 |
| 223 void MdSettingsUI::DidStartNavigation( | 223 void MdSettingsUI::DidStartNavigation( |
| 224 content::NavigationHandle* navigation_handle) { | 224 content::NavigationHandle* navigation_handle) { |
| 225 if (navigation_handle->IsSamePage()) | 225 if (navigation_handle->IsSameDocument()) |
| 226 return; | 226 return; |
| 227 | 227 |
| 228 load_start_time_ = base::Time::Now(); | 228 load_start_time_ = base::Time::Now(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void MdSettingsUI::DocumentLoadedInFrame( | 231 void MdSettingsUI::DocumentLoadedInFrame( |
| 232 content::RenderFrameHost* render_frame_host) { | 232 content::RenderFrameHost* render_frame_host) { |
| 233 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", | 233 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", |
| 234 base::Time::Now() - load_start_time_); | 234 base::Time::Now() - load_start_time_); |
| 235 } | 235 } |
| 236 | 236 |
| 237 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { | 237 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { |
| 238 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", | 238 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", |
| 239 base::Time::Now() - load_start_time_); | 239 base::Time::Now() - load_start_time_); |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace settings | 242 } // namespace settings |
| OLD | NEW |