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

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

Issue 148113004: chromeos: Avoid notification for original Spring charger. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « ash/system/chromeos/power/power_status.cc ('k') | ash/system/chromeos/power/tray_power_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/power/tray_power.cc
diff --git a/ash/system/chromeos/power/tray_power.cc b/ash/system/chromeos/power/tray_power.cc
index 8bc68d5ec4e9506a16076a88bd6447baf4275d84..1dedf4896e8102f4f5ece199ad5254dcb2f5aa26 100644
--- a/ash/system/chromeos/power/tray_power.cc
+++ b/ash/system/chromeos/power/tray_power.cc
@@ -233,7 +233,8 @@ bool TrayPower::UpdateNotificationState() {
const PowerStatus& status = *PowerStatus::Get();
if (!status.IsBatteryPresent() ||
status.IsBatteryTimeBeingCalculated() ||
- status.IsMainsChargerConnected()) {
+ status.IsMainsChargerConnected() ||
+ status.IsOriginalSpringChargerConnected()) {
jennyz 2014/01/27 18:03:37 what if the user confirms they are using the safe
notification_state_ = NOTIFICATION_NONE;
return false;
}
@@ -249,7 +250,8 @@ bool TrayPower::UpdateNotificationStateForRemainingTime() {
const int remaining_minutes = static_cast<int>(
PowerStatus::Get()->GetBatteryTimeToEmpty().InSecondsF() / 60.0 + 0.5);
- if (remaining_minutes >= kNoWarningMinutes) {
+ if (remaining_minutes >= kNoWarningMinutes ||
+ PowerStatus::Get()->IsBatteryFull()) {
Daniel Erat 2014/01/27 17:36:26 These IsBatteryFull() checks aren't necessary for
jennyz 2014/01/27 18:03:37 agree.
notification_state_ = NOTIFICATION_NONE;
return false;
}
@@ -284,7 +286,8 @@ bool TrayPower::UpdateNotificationStateForRemainingPercentage() {
const int remaining_percentage =
PowerStatus::Get()->GetRoundedBatteryPercent();
- if (remaining_percentage >= kNoWarningPercentage) {
+ if (remaining_percentage >= kNoWarningPercentage ||
+ PowerStatus::Get()->IsBatteryFull()) {
notification_state_ = NOTIFICATION_NONE;
return false;
}
« no previous file with comments | « ash/system/chromeos/power/power_status.cc ('k') | ash/system/chromeos/power/tray_power_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698