Chromium Code Reviews| 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 1eb004840caca6dea72901ec19409310fc870192..735123da76eb59fac642c7bda978bbb677c2d85f 100644 |
| --- a/ash/system/chromeos/power/tray_power.cc |
| +++ b/ash/system/chromeos/power/tray_power.cc |
| @@ -5,9 +5,11 @@ |
| #include "ash/system/chromeos/power/tray_power.h" |
| #include "ash/ash_switches.h" |
| +#include "ash/shell.h" |
| #include "ash/system/chromeos/power/power_status_view.h" |
| #include "ash/system/date/date_view.h" |
| #include "ash/system/system_notifier.h" |
| +#include "ash/system/tray/system_tray_delegate.h" |
| #include "ash/system/tray/tray_constants.h" |
| #include "ash/system/tray/tray_notification_view.h" |
| #include "ash/system/tray/tray_utils.h" |
| @@ -162,6 +164,9 @@ void TrayPower::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { |
| } |
| void TrayPower::OnPowerStatusChanged() { |
| + // Show spring charger replacement dialog if necessary. |
| + ShowChargerReplacementDialogIfNecessary(); |
| + |
| bool battery_alert = UpdateNotificationState(); |
| if (power_tray_) |
| power_tray_->UpdateStatus(battery_alert); |
| @@ -299,5 +304,13 @@ bool TrayPower::UpdateNotificationStateForRemainingPercentage() { |
| return false; |
| } |
| +void TrayPower::ShowChargerReplacementDialogIfNecessary() { |
|
Daniel Erat
2013/12/06 17:43:26
this separate method seems unnecessary; mind just
jennyz
2013/12/06 18:15:16
Done.
|
| + if (!PowerStatus::Get()->IsOriginalSpringChargerConnected()) |
| + return; |
| + |
| + ash::Shell::GetInstance()->system_tray_delegate()-> |
| + ShowSpringChargerReplacementDialog(); |
| +} |
| + |
| } // namespace internal |
| } // namespace ash |