| 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/power/tray_power.h" | 5 #include "ash/system/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/date/date_view.h" | 9 #include "ash/system/date/date_view.h" |
| 10 #include "ash/system/power/power_status_view.h" | 10 #include "ash/system/power/power_status_view.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 204 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
| 205 } | 205 } |
| 206 | 206 |
| 207 void TrayPower::OnPowerStatusChanged(const PowerSupplyStatus& status) { | 207 void TrayPower::OnPowerStatusChanged(const PowerSupplyStatus& status) { |
| 208 if (power_tray_) | 208 if (power_tray_) |
| 209 power_tray_->UpdatePowerStatus(status); | 209 power_tray_->UpdatePowerStatus(status); |
| 210 if (notification_view_) | 210 if (notification_view_) |
| 211 notification_view_->UpdatePowerStatus(status); | 211 notification_view_->UpdatePowerStatus(status); |
| 212 | 212 |
| 213 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 213 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshNotify)) { |
| 214 switches::kAshNotifyDisabled)) { | |
| 215 if (UpdateNotificationState(status)) | 214 if (UpdateNotificationState(status)) |
| 216 ShowNotificationView(); | 215 ShowNotificationView(); |
| 217 else if (notification_state_ == NOTIFICATION_NONE) | 216 else if (notification_state_ == NOTIFICATION_NONE) |
| 218 HideNotificationView(); | 217 HideNotificationView(); |
| 219 } | 218 } |
| 220 } | 219 } |
| 221 | 220 |
| 222 bool TrayPower::UpdateNotificationState(const PowerSupplyStatus& status) { | 221 bool TrayPower::UpdateNotificationState(const PowerSupplyStatus& status) { |
| 223 if (!status.battery_is_present || | 222 if (!status.battery_is_present || |
| 224 status.is_calculating_battery_time || | 223 status.is_calculating_battery_time || |
| (...skipping 26 matching lines...) Expand all Loading... |
| 251 return false; | 250 return false; |
| 252 case NOTIFICATION_CRITICAL: | 251 case NOTIFICATION_CRITICAL: |
| 253 return false; | 252 return false; |
| 254 } | 253 } |
| 255 NOTREACHED(); | 254 NOTREACHED(); |
| 256 return false; | 255 return false; |
| 257 } | 256 } |
| 258 | 257 |
| 259 } // namespace internal | 258 } // namespace internal |
| 260 } // namespace ash | 259 } // namespace ash |
| OLD | NEW |