Chromium Code Reviews| Index: chromeos/dbus/power_policy_controller.cc |
| diff --git a/chromeos/dbus/power_policy_controller.cc b/chromeos/dbus/power_policy_controller.cc |
| index 5edc5bd9fd3a63d1792b4706c10c4b47ac150714..5d1c8ae543d867794e632d6245233e25fad0fb49 100644 |
| --- a/chromeos/dbus/power_policy_controller.cc |
| +++ b/chromeos/dbus/power_policy_controller.cc |
| @@ -157,8 +157,9 @@ void PowerPolicyController::ApplyPrefs(const PrefValues& values) { |
| int64 lock_ms = delays->screen_off_ms() + kScreenLockAfterOffDelayMs; |
| if (values.enable_screen_lock && delays->screen_off_ms() > 0 && |
| (delays->screen_lock_ms() <= 0 || lock_ms < delays->screen_lock_ms()) && |
| - lock_ms < delays->idle_ms()) |
| + lock_ms < delays->idle_ms()) { |
|
Daniel Erat
2013/06/28 17:05:09
for what it's worth, i've been told in previous re
bartfab (slow)
2013/07/01 12:32:59
The style guide definitely does not forbid them:
Daniel Erat
2013/07/01 14:29:05
sounds fine. for what it's worth, the distinction
bartfab (slow)
2013/07/01 14:53:08
It seems that different reviewers interpret the st
Daniel Erat
2013/07/01 14:53:52
i'm certainly fine with leaving it like this
|
| delays->set_screen_lock_ms(lock_ms); |
| + } |
| delays = prefs_policy_.mutable_battery_delays(); |
| delays->set_screen_dim_ms(values.battery_screen_dim_delay_ms); |
| @@ -170,8 +171,9 @@ void PowerPolicyController::ApplyPrefs(const PrefValues& values) { |
| lock_ms = delays->screen_off_ms() + kScreenLockAfterOffDelayMs; |
| if (values.enable_screen_lock && delays->screen_off_ms() > 0 && |
| (delays->screen_lock_ms() <= 0 || lock_ms < delays->screen_lock_ms()) && |
| - lock_ms < delays->idle_ms()) |
| + lock_ms < delays->idle_ms()) { |
| delays->set_screen_lock_ms(lock_ms); |
| + } |
| prefs_policy_.set_ac_idle_action(GetProtoAction(values.ac_idle_action)); |
| prefs_policy_.set_battery_idle_action( |
| @@ -190,6 +192,13 @@ void PowerPolicyController::ApplyPrefs(const PrefValues& values) { |
| SendCurrentPolicy(); |
| } |
| +void PowerPolicyController::ClearPrefs() { |
| + prefs_policy_.Clear(); |
| + honor_screen_wake_locks_ = true; |
| + prefs_were_set_ = false; |
| + SendCurrentPolicy(); |
| +} |
| + |
| int PowerPolicyController::AddScreenWakeLock(const std::string& reason) { |
| int id = next_wake_lock_id_++; |
| screen_wake_locks_[id] = reason; |