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

Unified Diff: chrome/browser/chromeos/dbus/power_manager_client.cc

Issue 8555018: Increased battery time to empty sent by power manager stub impl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: increased time to empty full battery Created 9 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698