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" |
11 #include "ash/system/power/power_supply_status.h" | 11 #include "ash/system/power/power_supply_status.h" |
| 12 #include "ash/system/tray/system_tray.h" |
12 #include "ash/system/tray/system_tray_delegate.h" | 13 #include "ash/system/tray/system_tray_delegate.h" |
13 #include "ash/system/tray/tray_constants.h" | 14 #include "ash/system/tray/tray_constants.h" |
14 #include "ash/system/tray/tray_notification_view.h" | 15 #include "ash/system/tray/tray_notification_view.h" |
15 #include "ash/system/tray/tray_views.h" | 16 #include "ash/system/tray/tray_views.h" |
16 #include "base/command_line.h" | 17 #include "base/command_line.h" |
17 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
18 #include "base/stringprintf.h" | 19 #include "base/stringprintf.h" |
19 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
20 #include "grit/ash_resources.h" | 21 #include "grit/ash_resources.h" |
21 #include "grit/ash_strings.h" | 22 #include "grit/ash_strings.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // Index of the current icon in the icon array image, or -1 if unknown. | 127 // Index of the current icon in the icon array image, or -1 if unknown. |
127 int battery_icon_index_; | 128 int battery_icon_index_; |
128 | 129 |
129 DISALLOW_COPY_AND_ASSIGN(PowerNotificationView); | 130 DISALLOW_COPY_AND_ASSIGN(PowerNotificationView); |
130 }; | 131 }; |
131 | 132 |
132 } // namespace tray | 133 } // namespace tray |
133 | 134 |
134 using tray::PowerNotificationView; | 135 using tray::PowerNotificationView; |
135 | 136 |
136 TrayPower::TrayPower() | 137 TrayPower::TrayPower(SystemTray* system_tray) |
137 : power_tray_(NULL), | 138 : SystemTrayItem(system_tray), |
| 139 power_tray_(NULL), |
138 notification_view_(NULL), | 140 notification_view_(NULL), |
139 notification_state_(NOTIFICATION_NONE) { | 141 notification_state_(NOTIFICATION_NONE) { |
140 } | 142 } |
141 | 143 |
142 TrayPower::~TrayPower() { | 144 TrayPower::~TrayPower() { |
143 } | 145 } |
144 | 146 |
145 // static | 147 // static |
146 int TrayPower::GetBatteryImageIndex(const PowerSupplyStatus& supply_status) { | 148 int TrayPower::GetBatteryImageIndex(const PowerSupplyStatus& supply_status) { |
147 int image_index = 0; | 149 int image_index = 0; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 return false; | 267 return false; |
266 case NOTIFICATION_CRITICAL: | 268 case NOTIFICATION_CRITICAL: |
267 return false; | 269 return false; |
268 } | 270 } |
269 NOTREACHED(); | 271 NOTREACHED(); |
270 return false; | 272 return false; |
271 } | 273 } |
272 | 274 |
273 } // namespace internal | 275 } // namespace internal |
274 } // namespace ash | 276 } // namespace ash |
OLD | NEW |