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

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

Issue 2513673005: Vulcanize Settings (Closed)
Patch Set: don't error on applied patch Created 4 years 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/resources/settings/vulcanize.py ('k') | patch_vulcanize.sh » ('j') | 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 chromeos::settings::DateTimeHandler::Create(html_source)); 133 chromeos::settings::DateTimeHandler::Create(html_source));
134 134
135 html_source->AddBoolean("stylusAllowed", ash::IsPaletteFeatureEnabled()); 135 html_source->AddBoolean("stylusAllowed", ash::IsPaletteFeatureEnabled());
136 html_source->AddBoolean("pinUnlockEnabled", 136 html_source->AddBoolean("pinUnlockEnabled",
137 chromeos::IsPinUnlockEnabled(profile->GetPrefs())); 137 chromeos::IsPinUnlockEnabled(profile->GetPrefs()));
138 #endif 138 #endif
139 139
140 AddSettingsPageUIHandler(AboutHandler::Create(html_source, profile)); 140 AddSettingsPageUIHandler(AboutHandler::Create(html_source, profile));
141 AddSettingsPageUIHandler(ResetSettingsHandler::Create(html_source, profile)); 141 AddSettingsPageUIHandler(ResetSettingsHandler::Create(html_source, profile));
142 142
143 #if BUILDFLAG(USE_VULCANIZE)
144 html_source->AddResourcePath("crisper.js",
145 IDR_SETTINGS_CRISPER_JS);
146 html_source->SetDefaultResource(IDR_SETTINGS_VULCANIZED_HTML);
147 #else
143 // Add all settings resources. 148 // Add all settings resources.
144 for (size_t i = 0; i < kSettingsResourcesSize; ++i) { 149 for (size_t i = 0; i < kSettingsResourcesSize; ++i) {
145 html_source->AddResourcePath(kSettingsResources[i].name, 150 html_source->AddResourcePath(kSettingsResources[i].name,
146 kSettingsResources[i].value); 151 kSettingsResources[i].value);
147 } 152 }
153 html_source->SetDefaultResource(IDR_SETTINGS_SETTINGS_HTML);
154 #endif
148 155
149 AddLocalizedStrings(html_source, profile); 156 AddLocalizedStrings(html_source, profile);
150 html_source->SetDefaultResource(IDR_SETTINGS_SETTINGS_HTML);
151 157
152 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), 158 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
153 html_source); 159 html_source);
154 } 160 }
155 161
156 MdSettingsUI::~MdSettingsUI() { 162 MdSettingsUI::~MdSettingsUI() {
157 } 163 }
158 164
159 void MdSettingsUI::AddSettingsPageUIHandler(SettingsPageUIHandler* handler) { 165 void MdSettingsUI::AddSettingsPageUIHandler(SettingsPageUIHandler* handler) {
160 DCHECK(handler); 166 DCHECK(handler);
(...skipping 14 matching lines...) Expand all
175 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", 181 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD",
176 base::Time::Now() - load_start_time_); 182 base::Time::Now() - load_start_time_);
177 } 183 }
178 184
179 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { 185 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() {
180 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", 186 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD",
181 base::Time::Now() - load_start_time_); 187 base::Time::Now() - load_start_time_);
182 } 188 }
183 189
184 } // namespace settings 190 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/vulcanize.py ('k') | patch_vulcanize.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698