| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/chromeos/power/tray_power.h" | 5 #include "ash/system/chromeos/power/tray_power.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/chromeos/power/power_status_view.h" | 9 #include "ash/system/chromeos/power/power_status_view.h" |
| 10 #include "ash/system/date/date_view.h" | 10 #include "ash/system/date/date_view.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 161 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
| 162 } | 162 } |
| 163 | 163 |
| 164 void TrayPower::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { | 164 void TrayPower::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { |
| 165 SetTrayImageItemBorder(power_tray_, alignment); | 165 SetTrayImageItemBorder(power_tray_, alignment); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void TrayPower::OnPowerStatusChanged() { | 168 void TrayPower::OnPowerStatusChanged() { |
| 169 RecordChargerType(); | 169 RecordChargerType(); |
| 170 | 170 |
| 171 if (PowerStatus::Get()->IsOriginalSpringChargerConnected()) { | 171 // TODO(jennyz): Enable showing spring charger dialog on locked screen after |
| 172 // crbug.com/328593 is fixed. |
| 173 user::LoginStatus login_status = |
| 174 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus(); |
| 175 if (PowerStatus::Get()->IsOriginalSpringChargerConnected() && |
| 176 (login_status != user::LOGGED_IN_NONE && |
| 177 login_status != user::LOGGED_IN_LOCKED)) { |
| 172 ash::Shell::GetInstance()->system_tray_delegate()-> | 178 ash::Shell::GetInstance()->system_tray_delegate()-> |
| 173 ShowSpringChargerReplacementDialog(); | 179 ShowSpringChargerReplacementDialog(); |
| 174 } | 180 } |
| 175 | 181 |
| 176 bool battery_alert = UpdateNotificationState(); | 182 bool battery_alert = UpdateNotificationState(); |
| 177 if (power_tray_) | 183 if (power_tray_) |
| 178 power_tray_->UpdateStatus(battery_alert); | 184 power_tray_->UpdateStatus(battery_alert); |
| 179 if (notification_view_) | 185 if (notification_view_) |
| 180 notification_view_->UpdateStatus(); | 186 notification_view_->UpdateStatus(); |
| 181 | 187 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 338 |
| 333 if (current_charger != UNKNOWN_CHARGER) { | 339 if (current_charger != UNKNOWN_CHARGER) { |
| 334 UMA_HISTOGRAM_ENUMERATION("Power.ChargerType", | 340 UMA_HISTOGRAM_ENUMERATION("Power.ChargerType", |
| 335 current_charger, | 341 current_charger, |
| 336 CHARGER_TYPE_COUNT); | 342 CHARGER_TYPE_COUNT); |
| 337 } | 343 } |
| 338 } | 344 } |
| 339 | 345 |
| 340 } // namespace internal | 346 } // namespace internal |
| 341 } // namespace ash | 347 } // namespace ash |
| OLD | NEW |