summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-23 18:01:45 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-23 18:01:45 +0000
commita64dae979865e989fb93e4863d399492b5db4fa6 (patch)
tree265161e556a64aa8ef423f6f1209fb82e9e28f4d /chromeos
parent291857af65204e33d227e0ce356198655b22249f (diff)
downloadchromium_src-a64dae979865e989fb93e4863d399492b5db4fa6.zip
chromium_src-a64dae979865e989fb93e4863d399492b5db4fa6.tar.gz
chromium_src-a64dae979865e989fb93e4863d399492b5db4fa6.tar.bz2
chromeos: Rename kEnableScreenLock to kEnableAutoScreenLock.
Rename a confusingly-named pref. BUG=none TBR=rsimha@chromium.org Review URL: https://codereview.chromium.org/143823005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246636 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/dbus/power_policy_controller.cc8
-rw-r--r--chromeos/dbus/power_policy_controller.h10
-rw-r--r--chromeos/dbus/power_policy_controller_unittest.cc6
3 files changed, 12 insertions, 12 deletions
diff --git a/chromeos/dbus/power_policy_controller.cc b/chromeos/dbus/power_policy_controller.cc
index 6cd696f..587dca4 100644
--- a/chromeos/dbus/power_policy_controller.cc
+++ b/chromeos/dbus/power_policy_controller.cc
@@ -84,7 +84,7 @@ PowerPolicyController::PrefValues::PrefValues()
ac_brightness_percent(-1.0),
battery_brightness_percent(-1.0),
allow_screen_wake_locks(true),
- enable_screen_lock(false),
+ enable_auto_screen_lock(false),
presentation_screen_dim_delay_factor(1.0),
user_activity_screen_dim_delay_factor(1.0),
wait_for_initial_user_activity(false) {}
@@ -163,10 +163,10 @@ void PowerPolicyController::ApplyPrefs(const PrefValues& values) {
delays->set_idle_warning_ms(values.ac_idle_warning_delay_ms);
delays->set_idle_ms(values.ac_idle_delay_ms);
- // If screen-locking is enabled, ensure that the screen is locked soon
+ // If auto screen-locking is enabled, ensure that the screen is locked soon
// after it's turned off due to user inactivity.
int64 lock_ms = delays->screen_off_ms() + kScreenLockAfterOffDelayMs;
- if (values.enable_screen_lock && delays->screen_off_ms() > 0 &&
+ if (values.enable_auto_screen_lock && delays->screen_off_ms() > 0 &&
(delays->screen_lock_ms() <= 0 || lock_ms < delays->screen_lock_ms()) &&
lock_ms < delays->idle_ms()) {
delays->set_screen_lock_ms(lock_ms);
@@ -180,7 +180,7 @@ void PowerPolicyController::ApplyPrefs(const PrefValues& values) {
delays->set_idle_ms(values.battery_idle_delay_ms);
lock_ms = delays->screen_off_ms() + kScreenLockAfterOffDelayMs;
- if (values.enable_screen_lock && delays->screen_off_ms() > 0 &&
+ if (values.enable_auto_screen_lock && delays->screen_off_ms() > 0 &&
(delays->screen_lock_ms() <= 0 || lock_ms < delays->screen_lock_ms()) &&
lock_ms < delays->idle_ms()) {
delays->set_screen_lock_ms(lock_ms);
diff --git a/chromeos/dbus/power_policy_controller.h b/chromeos/dbus/power_policy_controller.h
index cb994cd..4939a00 100644
--- a/chromeos/dbus/power_policy_controller.h
+++ b/chromeos/dbus/power_policy_controller.h
@@ -53,7 +53,7 @@ class CHROMEOS_EXPORT PowerPolicyController
double ac_brightness_percent;
double battery_brightness_percent;
bool allow_screen_wake_locks;
- bool enable_screen_lock;
+ bool enable_auto_screen_lock;
double presentation_screen_dim_delay_factor;
double user_activity_screen_dim_delay_factor;
bool wait_for_initial_user_activity;
@@ -63,10 +63,10 @@ class CHROMEOS_EXPORT PowerPolicyController
static std::string GetPolicyDebugString(
const power_manager::PowerManagementPolicy& policy);
- // Delay in milliseconds between the screen being turned off and the
- // screen being locked. Used if the |enable_screen_lock| pref is set but
- // |*_screen_lock_delay_ms| are unset or set to higher values than what
- // this constant would imply.
+ // Delay in milliseconds between the screen being turned off and the screen
+ // being locked. Used if the |enable_auto_screen_lock| pref is set but
+ // |*_screen_lock_delay_ms| are unset or set to higher values than what this
+ // constant would imply.
static const int kScreenLockAfterOffDelayMs;
PowerPolicyController();
diff --git a/chromeos/dbus/power_policy_controller_unittest.cc b/chromeos/dbus/power_policy_controller_unittest.cc
index a2c1eb6..b4e7bf4 100644
--- a/chromeos/dbus/power_policy_controller_unittest.cc
+++ b/chromeos/dbus/power_policy_controller_unittest.cc
@@ -58,7 +58,7 @@ TEST_F(PowerPolicyControllerTest, Prefs) {
prefs.use_video_activity = true;
prefs.ac_brightness_percent = 87.0;
prefs.battery_brightness_percent = 43.0;
- prefs.enable_screen_lock = false;
+ prefs.enable_auto_screen_lock = false;
prefs.presentation_screen_dim_delay_factor = 3.0;
prefs.user_activity_screen_dim_delay_factor = 2.0;
prefs.wait_for_initial_user_activity = true;
@@ -108,9 +108,9 @@ TEST_F(PowerPolicyControllerTest, Prefs) {
PowerPolicyController::GetPolicyDebugString(
fake_power_client_->policy()));
- // The enable-screen-lock pref should force the screen-lock delays to
+ // The enable-auto-screen-lock pref should force the screen-lock delays to
// match the screen-off delays plus a constant value.
- prefs.enable_screen_lock = true;
+ prefs.enable_auto_screen_lock = true;
policy_controller_->ApplyPrefs(prefs);
expected_policy.mutable_ac_delays()->set_screen_lock_ms(
660000 + PowerPolicyController::kScreenLockAfterOffDelayMs);