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

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

Issue 107103004: Implement the spring charger replacement UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 7 years 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
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

Powered by Google App Engine
This is Rietveld 408576698