Chromium Code Reviews| Index: chrome/browser/chromeos/dbus/power_manager_client.cc |
| diff --git a/chrome/browser/chromeos/dbus/power_manager_client.cc b/chrome/browser/chromeos/dbus/power_manager_client.cc |
| index dc9761d64cc6623ba667637f98eaf099ba5efada..366996e80fa656db684f4e2daf0ffb688e9b1579 100644 |
| --- a/chrome/browser/chromeos/dbus/power_manager_client.cc |
| +++ b/chrome/browser/chromeos/dbus/power_manager_client.cc |
| @@ -247,7 +247,8 @@ class PowerManagerClientStubImpl : public PowerManagerClient { |
| PowerManagerClientStubImpl() |
| : discharging_(true), |
| battery_percentage_(80), |
| - pause_count_(0) { |
| + pause_count_(0), |
| + kSecondsToEmptyFullBattery(3 * 60 * 60) /* 3 hours */ { |
|
satorux1
2011/11/14 22:59:50
It's awkward to make it a member variable. see bel
tbarzic
2011/11/14 23:05:39
Done.
|
| } |
| virtual ~PowerManagerClientStubImpl() {} |
| @@ -276,7 +277,7 @@ class PowerManagerClientStubImpl : public PowerManagerClient { |
| if (!timer_.IsRunning()) { |
| timer_.Start( |
| FROM_HERE, |
| - base::TimeDelta::FromMilliseconds(100), |
| + base::TimeDelta::FromMilliseconds(200), |
| this, |
| &PowerManagerClientStubImpl::Update); |
| } else { |
| @@ -301,7 +302,7 @@ class PowerManagerClientStubImpl : public PowerManagerClient { |
| pause_count_ = 0; |
| discharging_ = !discharging_; |
| } else { |
| - pause_count_ = 20; |
| + pause_count_ = 10; |
| return; |
| } |
| } |
| @@ -312,9 +313,10 @@ class PowerManagerClientStubImpl : public PowerManagerClient { |
| status.battery_is_present = true; |
| status.battery_percentage = battery_percentage_; |
| status.battery_seconds_to_empty = |
| - std::max(1, battery_percentage_ * 180 / 100); |
| + std::max(1, battery_percentage_ * kSecondsToEmptyFullBattery / 100); |
| status.battery_seconds_to_full = |
| - std::max(static_cast<int64>(1), 180 - status.battery_seconds_to_empty); |
| + std::max(static_cast<int64>(1), |
| + kSecondsToEmptyFullBattery - status.battery_seconds_to_empty); |
| FOR_EACH_OBSERVER(Observer, observers_, PowerChanged(status)); |
| } |
| @@ -322,6 +324,7 @@ class PowerManagerClientStubImpl : public PowerManagerClient { |
| bool discharging_; |
| int battery_percentage_; |
| int pause_count_; |
| + const int kSecondsToEmptyFullBattery; |
| ObserverList<Observer> observers_; |
| base::RepeatingTimer<PowerManagerClientStubImpl> timer_; |
| }; |