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_supply_status.h" | 10 #include "ash/system/power/power_supply_status.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 367 |
368 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 368 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
369 } | 369 } |
370 | 370 |
371 void TrayPower::OnPowerStatusChanged(const PowerSupplyStatus& status) { | 371 void TrayPower::OnPowerStatusChanged(const PowerSupplyStatus& status) { |
372 if (power_tray_) | 372 if (power_tray_) |
373 power_tray_->UpdatePowerStatus(status); | 373 power_tray_->UpdatePowerStatus(status); |
374 if (notification_view_) | 374 if (notification_view_) |
375 notification_view_->UpdatePowerStatus(status); | 375 notification_view_->UpdatePowerStatus(status); |
376 | 376 |
377 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraNotify)) { | 377 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshNotify)) { |
378 if (UpdateNotificationState(status)) | 378 if (UpdateNotificationState(status)) |
379 ShowNotificationView(); | 379 ShowNotificationView(); |
380 else if (notification_state_ == NOTIFICATION_NONE) | 380 else if (notification_state_ == NOTIFICATION_NONE) |
381 HideNotificationView(); | 381 HideNotificationView(); |
382 } | 382 } |
383 } | 383 } |
384 | 384 |
385 bool TrayPower::UpdateNotificationState(const PowerSupplyStatus& status) { | 385 bool TrayPower::UpdateNotificationState(const PowerSupplyStatus& status) { |
386 if (!status.battery_is_present || | 386 if (!status.battery_is_present || |
387 status.is_calculating_battery_time || | 387 status.is_calculating_battery_time || |
(...skipping 26 matching lines...) Expand all Loading... |
414 return false; | 414 return false; |
415 case NOTIFICATION_CRITICAL: | 415 case NOTIFICATION_CRITICAL: |
416 return false; | 416 return false; |
417 } | 417 } |
418 NOTREACHED(); | 418 NOTREACHED(); |
419 return false; | 419 return false; |
420 } | 420 } |
421 | 421 |
422 } // namespace internal | 422 } // namespace internal |
423 } // namespace ash | 423 } // namespace ash |
OLD | NEW |