| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 chromeos::settings::EasyUnlockSettingsHandler* easy_unlock_handler = | 96 chromeos::settings::EasyUnlockSettingsHandler* easy_unlock_handler = |
| 97 chromeos::settings::EasyUnlockSettingsHandler::Create(html_source, | 97 chromeos::settings::EasyUnlockSettingsHandler::Create(html_source, |
| 98 profile); | 98 profile); |
| 99 if (easy_unlock_handler) | 99 if (easy_unlock_handler) |
| 100 AddSettingsPageUIHandler(easy_unlock_handler); | 100 AddSettingsPageUIHandler(easy_unlock_handler); |
| 101 #endif | 101 #endif |
| 102 | 102 |
| 103 AddSettingsPageUIHandler(AboutHandler::Create(html_source, profile)); | 103 AddSettingsPageUIHandler(AboutHandler::Create(html_source, profile)); |
| 104 AddSettingsPageUIHandler(ResetSettingsHandler::Create(html_source, profile)); | 104 AddSettingsPageUIHandler(ResetSettingsHandler::Create(html_source, profile)); |
| 105 | 105 |
| 106 #if BUILDFLAG(USE_VULCANIZE) |
| 107 html_source->AddResourcePath("crisper.js", |
| 108 IDR_SETTINGS_CRISPER_JS); |
| 109 html_source->SetDefaultResource(IDR_SETTINGS_VULCANIZED_HTML); |
| 110 #else |
| 106 // Add all settings resources. | 111 // Add all settings resources. |
| 107 for (size_t i = 0; i < kSettingsResourcesSize; ++i) { | 112 for (size_t i = 0; i < kSettingsResourcesSize; ++i) { |
| 108 html_source->AddResourcePath(kSettingsResources[i].name, | 113 html_source->AddResourcePath(kSettingsResources[i].name, |
| 109 kSettingsResources[i].value); | 114 kSettingsResources[i].value); |
| 110 } | 115 } |
| 116 html_source->SetDefaultResource(IDR_SETTINGS_SETTINGS_HTML); |
| 117 #endif |
| 111 | 118 |
| 112 AddLocalizedStrings(html_source, profile); | 119 AddLocalizedStrings(html_source, profile); |
| 113 html_source->SetDefaultResource(IDR_SETTINGS_SETTINGS_HTML); | |
| 114 | 120 |
| 115 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), | 121 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), |
| 116 html_source); | 122 html_source); |
| 117 } | 123 } |
| 118 | 124 |
| 119 MdSettingsUI::~MdSettingsUI() { | 125 MdSettingsUI::~MdSettingsUI() { |
| 120 } | 126 } |
| 121 | 127 |
| 122 void MdSettingsUI::AddSettingsPageUIHandler(SettingsPageUIHandler* handler) { | 128 void MdSettingsUI::AddSettingsPageUIHandler(SettingsPageUIHandler* handler) { |
| 123 DCHECK(handler); | 129 DCHECK(handler); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 138 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", | 144 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", |
| 139 base::Time::Now() - load_start_time_); | 145 base::Time::Now() - load_start_time_); |
| 140 } | 146 } |
| 141 | 147 |
| 142 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { | 148 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { |
| 143 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", | 149 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", |
| 144 base::Time::Now() - load_start_time_); | 150 base::Time::Now() - load_start_time_); |
| 145 } | 151 } |
| 146 | 152 |
| 147 } // namespace settings | 153 } // namespace settings |
| OLD | NEW |