| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // there is a battery or not. So always create this, and adjust visibility as | 177 // there is a battery or not. So always create this, and adjust visibility as |
| 178 // necessary. | 178 // necessary. |
| 179 PowerSupplyStatus power_status = | 179 PowerSupplyStatus power_status = |
| 180 ash::Shell::GetInstance()->tray_delegate()->GetPowerSupplyStatus(); | 180 ash::Shell::GetInstance()->tray_delegate()->GetPowerSupplyStatus(); |
| 181 CHECK(power_tray_ == NULL); | 181 CHECK(power_tray_ == NULL); |
| 182 power_tray_ = new tray::PowerTrayView(); | 182 power_tray_ = new tray::PowerTrayView(); |
| 183 power_tray_->UpdatePowerStatus(power_status); | 183 power_tray_->UpdatePowerStatus(power_status); |
| 184 return power_tray_; | 184 return power_tray_; |
| 185 } | 185 } |
| 186 | 186 |
| 187 views::View* TrayPower::CreateDefaultView(user::LoginStatus status) { | 187 views::View* TrayPower::CreateDefaultView(user::LoginStatus status, |
| 188 int bubble_width) { |
| 188 // Make sure icon status is up-to-date. (Also triggers stub activation). | 189 // Make sure icon status is up-to-date. (Also triggers stub activation). |
| 189 ash::Shell::GetInstance()->tray_delegate()->RequestStatusUpdate(); | 190 ash::Shell::GetInstance()->tray_delegate()->RequestStatusUpdate(); |
| 190 return NULL; | 191 return NULL; |
| 191 } | 192 } |
| 192 | 193 |
| 193 views::View* TrayPower::CreateNotificationView(user::LoginStatus status) { | 194 views::View* TrayPower::CreateNotificationView(user::LoginStatus status) { |
| 194 CHECK(notification_view_ == NULL); | 195 CHECK(notification_view_ == NULL); |
| 195 PowerSupplyStatus power_status = | 196 PowerSupplyStatus power_status = |
| 196 ash::Shell::GetInstance()->tray_delegate()->GetPowerSupplyStatus(); | 197 ash::Shell::GetInstance()->tray_delegate()->GetPowerSupplyStatus(); |
| 197 if (!power_status.battery_is_present) | 198 if (!power_status.battery_is_present) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 return false; | 266 return false; |
| 266 case NOTIFICATION_CRITICAL: | 267 case NOTIFICATION_CRITICAL: |
| 267 return false; | 268 return false; |
| 268 } | 269 } |
| 269 NOTREACHED(); | 270 NOTREACHED(); |
| 270 return false; | 271 return false; |
| 271 } | 272 } |
| 272 | 273 |
| 273 } // namespace internal | 274 } // namespace internal |
| 274 } // namespace ash | 275 } // namespace ash |
| OLD | NEW |