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/tray/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell/panel_window.h" | 8 #include "ash/shell/panel_window.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/system/audio/tray_volume.h" | 10 #include "ash/system/audio/tray_volume.h" |
11 #include "ash/system/bluetooth/tray_bluetooth.h" | 11 #include "ash/system/bluetooth/tray_bluetooth.h" |
12 #include "ash/system/brightness/tray_brightness.h" | 12 #include "ash/system/brightness/tray_brightness.h" |
13 #include "ash/system/date/tray_date.h" | 13 #include "ash/system/date/tray_date.h" |
14 #include "ash/system/drive/tray_drive.h" | 14 #include "ash/system/drive/tray_drive.h" |
15 #include "ash/system/ime/tray_ime.h" | 15 #include "ash/system/ime/tray_ime.h" |
| 16 #include "ash/system/locale/tray_locale.h" |
16 #include "ash/system/network/tray_network.h" | 17 #include "ash/system/network/tray_network.h" |
17 #include "ash/system/network/tray_sms.h" | 18 #include "ash/system/network/tray_sms.h" |
18 #include "ash/system/power/power_status_observer.h" | 19 #include "ash/system/power/power_status_observer.h" |
19 #include "ash/system/power/power_supply_status.h" | 20 #include "ash/system/power/power_supply_status.h" |
20 #include "ash/system/power/tray_power.h" | 21 #include "ash/system/power/tray_power.h" |
21 #include "ash/system/settings/tray_settings.h" | 22 #include "ash/system/settings/tray_settings.h" |
22 #include "ash/system/tray/system_tray_bubble.h" | 23 #include "ash/system/tray/system_tray_bubble.h" |
23 #include "ash/system/tray/system_tray_delegate.h" | 24 #include "ash/system/tray/system_tray_delegate.h" |
24 #include "ash/system/tray/system_tray_item.h" | 25 #include "ash/system/tray/system_tray_item.h" |
25 #include "ash/system/tray/system_tray_widget_delegate.h" | 26 #include "ash/system/tray/system_tray_widget_delegate.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 SystemTray::SystemTray() | 156 SystemTray::SystemTray() |
156 : items_(), | 157 : items_(), |
157 accessibility_observer_(NULL), | 158 accessibility_observer_(NULL), |
158 audio_observer_(NULL), | 159 audio_observer_(NULL), |
159 bluetooth_observer_(NULL), | 160 bluetooth_observer_(NULL), |
160 brightness_observer_(NULL), | 161 brightness_observer_(NULL), |
161 caps_lock_observer_(NULL), | 162 caps_lock_observer_(NULL), |
162 clock_observer_(NULL), | 163 clock_observer_(NULL), |
163 drive_observer_(NULL), | 164 drive_observer_(NULL), |
164 ime_observer_(NULL), | 165 ime_observer_(NULL), |
| 166 locale_observer_(NULL), |
165 network_observer_(NULL), | 167 network_observer_(NULL), |
166 power_status_observer_(NULL), | 168 power_status_observer_(NULL), |
167 update_observer_(NULL), | 169 update_observer_(NULL), |
168 user_observer_(NULL), | 170 user_observer_(NULL), |
169 widget_(NULL), | 171 widget_(NULL), |
170 background_(new internal::SystemTrayBackground), | 172 background_(new internal::SystemTrayBackground), |
171 should_show_launcher_(false), | 173 should_show_launcher_(false), |
172 ALLOW_THIS_IN_INITIALIZER_LIST(hide_background_animator_(this, | 174 ALLOW_THIS_IN_INITIALIZER_LIST(hide_background_animator_(this, |
173 0, kTrayBackgroundAlpha)), | 175 0, kTrayBackgroundAlpha)), |
174 ALLOW_THIS_IN_INITIALIZER_LIST(hover_background_animator_(this, | 176 ALLOW_THIS_IN_INITIALIZER_LIST(hover_background_animator_(this, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 internal::TrayDate* tray_date = new internal::TrayDate(); | 209 internal::TrayDate* tray_date = new internal::TrayDate(); |
208 internal::TrayPower* tray_power = new internal::TrayPower(); | 210 internal::TrayPower* tray_power = new internal::TrayPower(); |
209 internal::TrayNetwork* tray_network = new internal::TrayNetwork; | 211 internal::TrayNetwork* tray_network = new internal::TrayNetwork; |
210 internal::TraySms* tray_sms = new internal::TraySms(); | 212 internal::TraySms* tray_sms = new internal::TraySms(); |
211 internal::TrayUser* tray_user = new internal::TrayUser; | 213 internal::TrayUser* tray_user = new internal::TrayUser; |
212 internal::TrayAccessibility* tray_accessibility = | 214 internal::TrayAccessibility* tray_accessibility = |
213 new internal::TrayAccessibility; | 215 new internal::TrayAccessibility; |
214 internal::TrayCapsLock* tray_caps_lock = new internal::TrayCapsLock; | 216 internal::TrayCapsLock* tray_caps_lock = new internal::TrayCapsLock; |
215 internal::TrayDrive* tray_drive = new internal::TrayDrive; | 217 internal::TrayDrive* tray_drive = new internal::TrayDrive; |
216 internal::TrayIME* tray_ime = new internal::TrayIME; | 218 internal::TrayIME* tray_ime = new internal::TrayIME; |
| 219 internal::TrayLocale* tray_locale = new internal::TrayLocale; |
217 internal::TrayUpdate* tray_update = new internal::TrayUpdate; | 220 internal::TrayUpdate* tray_update = new internal::TrayUpdate; |
218 | 221 |
219 accessibility_observer_ = tray_accessibility; | 222 accessibility_observer_ = tray_accessibility; |
220 audio_observer_ = tray_volume; | 223 audio_observer_ = tray_volume; |
221 bluetooth_observer_ = tray_bluetooth; | 224 bluetooth_observer_ = tray_bluetooth; |
222 brightness_observer_ = tray_brightness; | 225 brightness_observer_ = tray_brightness; |
223 caps_lock_observer_ = tray_caps_lock; | 226 caps_lock_observer_ = tray_caps_lock; |
224 clock_observer_ = tray_date; | 227 clock_observer_ = tray_date; |
225 drive_observer_ = tray_drive; | 228 drive_observer_ = tray_drive; |
226 ime_observer_ = tray_ime; | 229 ime_observer_ = tray_ime; |
| 230 locale_observer_ = tray_locale; |
227 network_observer_ = tray_network; | 231 network_observer_ = tray_network; |
228 power_status_observer_ = tray_power; | 232 power_status_observer_ = tray_power; |
229 update_observer_ = tray_update; | 233 update_observer_ = tray_update; |
230 user_observer_ = tray_user; | 234 user_observer_ = tray_user; |
231 | 235 |
232 AddTrayItem(tray_user); | 236 AddTrayItem(tray_user); |
233 AddTrayItem(tray_power); | 237 AddTrayItem(tray_power); |
234 AddTrayItem(tray_network); | 238 AddTrayItem(tray_network); |
235 AddTrayItem(tray_bluetooth); | 239 AddTrayItem(tray_bluetooth); |
236 AddTrayItem(tray_sms); | 240 AddTrayItem(tray_sms); |
237 AddTrayItem(tray_drive); | 241 AddTrayItem(tray_drive); |
238 AddTrayItem(tray_ime); | 242 AddTrayItem(tray_ime); |
| 243 AddTrayItem(tray_locale); |
239 AddTrayItem(tray_volume); | 244 AddTrayItem(tray_volume); |
240 AddTrayItem(tray_brightness); | 245 AddTrayItem(tray_brightness); |
241 AddTrayItem(tray_update); | 246 AddTrayItem(tray_update); |
242 AddTrayItem(tray_accessibility); | 247 AddTrayItem(tray_accessibility); |
243 AddTrayItem(tray_caps_lock); | 248 AddTrayItem(tray_caps_lock); |
244 AddTrayItem(new internal::TraySettings()); | 249 AddTrayItem(new internal::TraySettings()); |
245 AddTrayItem(tray_date); | 250 AddTrayItem(tray_date); |
246 SetVisible(ash::Shell::GetInstance()->tray_delegate()-> | 251 SetVisible(ash::Shell::GetInstance()->tray_delegate()-> |
247 GetTrayVisibilityOnStartup()); | 252 GetTrayVisibilityOnStartup()); |
248 } | 253 } |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 canvas->DrawFocusRect(tray_container_->bounds()); | 560 canvas->DrawFocusRect(tray_container_->bounds()); |
556 } | 561 } |
557 | 562 |
558 void SystemTray::UpdateBackground(int alpha) { | 563 void SystemTray::UpdateBackground(int alpha) { |
559 background_->set_alpha(hide_background_animator_.alpha() + | 564 background_->set_alpha(hide_background_animator_.alpha() + |
560 hover_background_animator_.alpha()); | 565 hover_background_animator_.alpha()); |
561 SchedulePaint(); | 566 SchedulePaint(); |
562 } | 567 } |
563 | 568 |
564 } // namespace ash | 569 } // namespace ash |
OLD | NEW |