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

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

Issue 2853113004: chromeos: Add settings to control power management prefs. (Closed)
Patch Set: switch back from aria-labelledby to aria-label Created 3 years, 6 months 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
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 "quickUnlockEnabled", 203 "quickUnlockEnabled",
204 chromeos::quick_unlock::IsPinEnabled(profile->GetPrefs())); 204 chromeos::quick_unlock::IsPinEnabled(profile->GetPrefs()));
205 html_source->AddBoolean("fingerprintUnlockEnabled", 205 html_source->AddBoolean("fingerprintUnlockEnabled",
206 chromeos::quick_unlock::IsFingerprintEnabled()); 206 chromeos::quick_unlock::IsFingerprintEnabled());
207 html_source->AddBoolean("androidAppsVisible", 207 html_source->AddBoolean("androidAppsVisible",
208 arc::IsArcAllowedForProfile(profile) && 208 arc::IsArcAllowedForProfile(profile) &&
209 !arc::IsArcOptInVerificationDisabled() && 209 !arc::IsArcOptInVerificationDisabled() &&
210 arc::IsPlayStoreAvailable()); 210 arc::IsPlayStoreAvailable());
211 211
212 // TODO(mash): Support Chrome power settings in Mash. crbug.com/644348 212 // TODO(mash): Support Chrome power settings in Mash. crbug.com/644348
213 bool enable_power_settings = 213 bool enable_power_settings = !ash_util::IsRunningInMash();
214 !ash_util::IsRunningInMash() &&
215 (switches::PowerOverlayEnabled() ||
216 (ash::PowerStatus::Get()->IsBatteryPresent() &&
217 ash::PowerStatus::Get()->SupportsDualRoleDevices()));
218 html_source->AddBoolean("enablePowerSettings", enable_power_settings); 214 html_source->AddBoolean("enablePowerSettings", enable_power_settings);
219 if (enable_power_settings) { 215 if (enable_power_settings) {
220 AddSettingsPageUIHandler( 216 AddSettingsPageUIHandler(base::MakeUnique<chromeos::settings::PowerHandler>(
221 base::MakeUnique<chromeos::settings::PowerHandler>()); 217 profile->GetPrefs()));
222 } 218 }
223 #endif 219 #endif
224 220
225 AddSettingsPageUIHandler( 221 AddSettingsPageUIHandler(
226 base::WrapUnique(AboutHandler::Create(html_source, profile))); 222 base::WrapUnique(AboutHandler::Create(html_source, profile)));
227 AddSettingsPageUIHandler( 223 AddSettingsPageUIHandler(
228 base::WrapUnique(ResetSettingsHandler::Create(html_source, profile))); 224 base::WrapUnique(ResetSettingsHandler::Create(html_source, profile)));
229 225
230 // Add the metrics handler to write uma stats. 226 // Add the metrics handler to write uma stats.
231 web_ui->AddMessageHandler(base::MakeUnique<MetricsHandler>()); 227 web_ui->AddMessageHandler(base::MakeUnique<MetricsHandler>());
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", 272 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD",
277 base::Time::Now() - load_start_time_); 273 base::Time::Now() - load_start_time_);
278 } 274 }
279 275
280 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { 276 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() {
281 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", 277 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD",
282 base::Time::Now() - load_start_time_); 278 base::Time::Now() - load_start_time_);
283 } 279 }
284 280
285 } // namespace settings 281 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698