| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 AddSettingsPageUIHandler( | 198 AddSettingsPageUIHandler( |
| 199 base::WrapUnique(AboutHandler::Create(html_source, profile))); | 199 base::WrapUnique(AboutHandler::Create(html_source, profile))); |
| 200 AddSettingsPageUIHandler( | 200 AddSettingsPageUIHandler( |
| 201 base::WrapUnique(ResetSettingsHandler::Create(html_source, profile))); | 201 base::WrapUnique(ResetSettingsHandler::Create(html_source, profile))); |
| 202 | 202 |
| 203 // Add the metrics handler to write uma stats. | 203 // Add the metrics handler to write uma stats. |
| 204 web_ui->AddMessageHandler(base::MakeUnique<MetricsHandler>()); | 204 web_ui->AddMessageHandler(base::MakeUnique<MetricsHandler>()); |
| 205 | 205 |
| 206 #if BUILDFLAG(USE_VULCANIZE) | 206 #if BUILDFLAG(USE_VULCANIZE) |
| 207 html_source->AddResourcePath("crisper.js", IDR_MD_SETTINGS_CRISPER_JS); | 207 html_source->AddResourcePath("crisper.js", IDR_MD_SETTINGS_CRISPER_JS); |
| 208 html_source->AddResourcePath("lazy_load.crisper.js", |
| 209 IDR_MD_SETTINGS_LAZY_LOAD_CRISPER_JS); |
| 210 html_source->AddResourcePath("lazy_load.html", |
| 211 IDR_MD_SETTINGS_LAZY_LOAD_VULCANIZED_HTML); |
| 208 html_source->SetDefaultResource(IDR_MD_SETTINGS_VULCANIZED_HTML); | 212 html_source->SetDefaultResource(IDR_MD_SETTINGS_VULCANIZED_HTML); |
| 209 html_source->UseGzip(std::unordered_set<std::string>()); | 213 html_source->UseGzip(std::unordered_set<std::string>()); |
| 210 #else | 214 #else |
| 211 // Add all settings resources. | 215 // Add all settings resources. |
| 212 for (size_t i = 0; i < kSettingsResourcesSize; ++i) { | 216 for (size_t i = 0; i < kSettingsResourcesSize; ++i) { |
| 213 html_source->AddResourcePath(kSettingsResources[i].name, | 217 html_source->AddResourcePath(kSettingsResources[i].name, |
| 214 kSettingsResources[i].value); | 218 kSettingsResources[i].value); |
| 215 } | 219 } |
| 216 html_source->SetDefaultResource(IDR_SETTINGS_SETTINGS_HTML); | 220 html_source->SetDefaultResource(IDR_SETTINGS_SETTINGS_HTML); |
| 217 #endif | 221 #endif |
| (...skipping 27 matching lines...) Expand all Loading... |
| 245 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", | 249 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", |
| 246 base::Time::Now() - load_start_time_); | 250 base::Time::Now() - load_start_time_); |
| 247 } | 251 } |
| 248 | 252 |
| 249 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { | 253 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { |
| 250 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", | 254 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", |
| 251 base::Time::Now() - load_start_time_); | 255 base::Time::Now() - load_start_time_); |
| 252 } | 256 } |
| 253 | 257 |
| 254 } // namespace settings | 258 } // namespace settings |
| OLD | NEW |