| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 AddSettingsPageUIHandler(base::MakeUnique<SystemHandler>()); | 134 AddSettingsPageUIHandler(base::MakeUnique<SystemHandler>()); |
| 135 #endif | 135 #endif |
| 136 | 136 |
| 137 // Host must be derived from the visible URL, since this might be serving | 137 // Host must be derived from the visible URL, since this might be serving |
| 138 // either chrome://settings or chrome://md-settings. | 138 // either chrome://settings or chrome://md-settings. |
| 139 CHECK(url.GetOrigin() == GURL(chrome::kChromeUISettingsURL).GetOrigin() || | 139 CHECK(url.GetOrigin() == GURL(chrome::kChromeUISettingsURL).GetOrigin() || |
| 140 url.GetOrigin() == GURL(chrome::kChromeUIMdSettingsURL).GetOrigin()); | 140 url.GetOrigin() == GURL(chrome::kChromeUIMdSettingsURL).GetOrigin()); |
| 141 | 141 |
| 142 content::WebUIDataSource* html_source = | 142 content::WebUIDataSource* html_source = |
| 143 content::WebUIDataSource::Create(url.host()); | 143 content::WebUIDataSource::Create(url.host()); |
| 144 html_source->AddString("hostname", url.host()); |
| 144 | 145 |
| 145 #if defined(OS_CHROMEOS) | 146 #if defined(OS_CHROMEOS) |
| 146 chromeos::settings::EasyUnlockSettingsHandler* easy_unlock_handler = | 147 chromeos::settings::EasyUnlockSettingsHandler* easy_unlock_handler = |
| 147 chromeos::settings::EasyUnlockSettingsHandler::Create(html_source, | 148 chromeos::settings::EasyUnlockSettingsHandler::Create(html_source, |
| 148 profile); | 149 profile); |
| 149 if (easy_unlock_handler) | 150 if (easy_unlock_handler) |
| 150 AddSettingsPageUIHandler(base::WrapUnique(easy_unlock_handler)); | 151 AddSettingsPageUIHandler(base::WrapUnique(easy_unlock_handler)); |
| 151 | 152 |
| 152 AddSettingsPageUIHandler(base::WrapUnique( | 153 AddSettingsPageUIHandler(base::WrapUnique( |
| 153 chromeos::settings::DateTimeHandler::Create(html_source))); | 154 chromeos::settings::DateTimeHandler::Create(html_source))); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", | 217 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", |
| 217 base::Time::Now() - load_start_time_); | 218 base::Time::Now() - load_start_time_); |
| 218 } | 219 } |
| 219 | 220 |
| 220 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { | 221 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { |
| 221 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", | 222 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", |
| 222 base::Time::Now() - load_start_time_); | 223 base::Time::Now() - load_start_time_); |
| 223 } | 224 } |
| 224 | 225 |
| 225 } // namespace settings | 226 } // namespace settings |
| OLD | NEW |