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

Unified Diff: chrome/browser/chromeos/preferences.cc

Issue 811973002: Enable lucid sleep (wake on wi-fi SSID) and add to Privacy options. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add function to chromeos::switches. rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/resources/options/browser_options.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/preferences.cc
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index 6cd809797e4b61c0e287509e105a754d7ca73102..0cfb9cbafd9bcc23c90d9b0e67cad8f2539a1883 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -272,13 +272,9 @@ void Preferences::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
// We don't sync wake-on-wifi related prefs because they are device specific.
- // TODO(chirantan): Default this to on when we are ready to launch.
- registry->RegisterIntegerPref(
- prefs::kWakeOnWiFiEnabled,
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kWakeOnPackets)
- ? WakeOnWifiManager::WAKE_ON_PACKET_AND_SSID
- : WakeOnWifiManager::WAKE_ON_NONE,
+ registry->RegisterBooleanPref(
+ prefs::kWakeOnWifiSsid,
+ true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
// Mobile plan notifications default to on.
@@ -358,7 +354,7 @@ void Preferences::InitUserPrefs(PrefServiceSyncable* prefs) {
xkb_auto_repeat_interval_pref_.Init(
prefs::kLanguageXkbAutoRepeatInterval, prefs, callback);
- wake_on_wifi_enabled_.Init(prefs::kWakeOnWiFiEnabled, prefs, callback);
+ wake_on_wifi_ssid_.Init(prefs::kWakeOnWifiSsid, prefs, callback);
}
void Preferences::Init(Profile* profile, const user_manager::User* user) {
@@ -573,13 +569,6 @@ void Preferences::ApplyPreferences(ApplyReason reason,
UpdateAutoRepeatRate();
}
- if (user_is_primary_ && (reason != REASON_PREF_CHANGED ||
- pref_name == prefs::kWakeOnWiFiEnabled)) {
- WakeOnWifiManager::Get()->OnPreferenceChanged(
- static_cast<WakeOnWifiManager::WakeOnWifiFeature>(
- wake_on_wifi_enabled_.GetValue()));
- }
-
if (reason == REASON_INITIALIZATION)
SetInputMethodList();
@@ -607,6 +596,17 @@ void Preferences::ApplyPreferences(ApplyReason reason,
touchpad_settings);
system::InputDeviceSettings::Get()->UpdateMouseSettings(mouse_settings);
}
+
+ if (user_is_primary_ && (reason != REASON_PREF_CHANGED ||
+ pref_name == prefs::kWakeOnWifiSsid)) {
+ int features = wake_on_wifi_ssid_.GetValue() ?
+ WakeOnWifiManager::WAKE_ON_SSID : WakeOnWifiManager::WAKE_ON_NONE;
+ // The flag enables wake on packets but doesn't update a preference.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWakeOnPackets))
+ features |= WakeOnWifiManager::WAKE_ON_PACKET;
+ WakeOnWifiManager::Get()->OnPreferenceChanged(
+ static_cast<WakeOnWifiManager::WakeOnWifiFeature>(features));
+ }
}
void Preferences::OnIsSyncingChanged() {
« no previous file with comments | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/resources/options/browser_options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698