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

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: a 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..481840d980288f37e32c8b547a20b1e33d306f26 100644
--- a/chrome/browser/chromeos/dbus/power_manager_client.cc
+++ b/chrome/browser/chromeos/dbus/power_manager_client.cc
@@ -276,7 +276,7 @@ class PowerManagerClientStubImpl : public PowerManagerClient {
if (!timer_.IsRunning()) {
timer_.Start(
FROM_HERE,
- base::TimeDelta::FromMilliseconds(100),
+ base::TimeDelta::FromMilliseconds(1000),
this,
&PowerManagerClientStubImpl::Update);
} else {
@@ -301,20 +301,25 @@ class PowerManagerClientStubImpl : public PowerManagerClient {
pause_count_ = 0;
discharging_ = !discharging_;
} else {
- pause_count_ = 20;
+ // Pause twice (i.e. skip updating the menu), including the current
+ // call to this function.
+ pause_count_ = 2;
return;
}
}
battery_percentage_ += (discharging_ ? -1 : 1);
+ const int kSecondsToEmptyFullBattery(3 * 60 * 60); // 3 hours.
+
PowerSupplyStatus status;
status.line_power_on = !discharging_;
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));
}
« 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