| 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 // TODO(jennyz): Enable showing spring charger dialog on locked screen after | 171 if (PowerStatus::Get()->IsOriginalSpringChargerConnected()) { |
| 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)) { | |
| 178 ash::Shell::GetInstance()->system_tray_delegate()-> | 172 ash::Shell::GetInstance()->system_tray_delegate()-> |
| 179 ShowSpringChargerReplacementDialog(); | 173 ShowSpringChargerReplacementDialog(); |
| 180 } | 174 } |
| 181 | 175 |
| 182 bool battery_alert = UpdateNotificationState(); | 176 bool battery_alert = UpdateNotificationState(); |
| 183 if (power_tray_) | 177 if (power_tray_) |
| 184 power_tray_->UpdateStatus(battery_alert); | 178 power_tray_->UpdateStatus(battery_alert); |
| 185 if (notification_view_) | 179 if (notification_view_) |
| 186 notification_view_->UpdateStatus(); | 180 notification_view_->UpdateStatus(); |
| 187 | 181 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 332 |
| 339 if (current_charger != UNKNOWN_CHARGER) { | 333 if (current_charger != UNKNOWN_CHARGER) { |
| 340 UMA_HISTOGRAM_ENUMERATION("Power.ChargerType", | 334 UMA_HISTOGRAM_ENUMERATION("Power.ChargerType", |
| 341 current_charger, | 335 current_charger, |
| 342 CHARGER_TYPE_COUNT); | 336 CHARGER_TYPE_COUNT); |
| 343 } | 337 } |
| 344 } | 338 } |
| 345 | 339 |
| 346 } // namespace internal | 340 } // namespace internal |
| 347 } // namespace ash | 341 } // namespace ash |
| OLD | NEW |