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

Unified Diff: ash/system/chromeos/power/power_status.cc

Issue 32443004: ash: Improve low-battery notification thresholds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months 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 | ash/system/chromeos/power/power_status_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/power/power_status.cc
diff --git a/ash/system/chromeos/power/power_status.cc b/ash/system/chromeos/power/power_status.cc
index 0283a0c3fece1e9faca6ad44302b86019b1ba79f..6b05401891118bd8cf960948af14c78a5d5d37fc 100644
--- a/ash/system/chromeos/power/power_status.cc
+++ b/ash/system/chromeos/power/power_status.cc
@@ -112,7 +112,9 @@ void PowerStatus::SplitTimeIntoHoursAndMinutes(const base::TimeDelta& time,
DCHECK(hours);
DCHECK(minutes);
*hours = time.InHours();
- *minutes = (time - base::TimeDelta::FromHours(*hours)).InMinutes();
+ const double seconds =
James Cook 2013/10/22 00:32:40 nit: Do you want to comment either here or in the
Daniel Erat 2013/10/22 03:22:05 Sure, updated the comment in the header.
+ (time - base::TimeDelta::FromHours(*hours)).InSecondsF();
+ *minutes = static_cast<int>(seconds / 60.0 + 0.5);
}
void PowerStatus::AddObserver(Observer* observer) {
« no previous file with comments | « no previous file | ash/system/chromeos/power/power_status_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698