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/network/tray_network.h" | 16 #include "ash/system/network/tray_network.h" |
17 #include "ash/system/power/power_status_observer.h" | 17 #include "ash/system/power/power_status_observer.h" |
18 #include "ash/system/power/power_supply_status.h" | 18 #include "ash/system/power/power_supply_status.h" |
19 #include "ash/system/power/tray_power.h" | 19 #include "ash/system/power/tray_power.h" |
20 #include "ash/system/settings/tray_settings.h" | 20 #include "ash/system/settings/tray_settings.h" |
21 #include "ash/system/tray/system_tray_bubble.h" | 21 #include "ash/system/tray/system_tray_bubble.h" |
22 #include "ash/system/tray/system_tray_delegate.h" | 22 #include "ash/system/tray/system_tray_delegate.h" |
23 #include "ash/system/tray/system_tray_item.h" | 23 #include "ash/system/tray/system_tray_item.h" |
24 #include "ash/system/tray/system_tray_widget_delegate.h" | 24 #include "ash/system/tray/system_tray_widget_delegate.h" |
25 #include "ash/system/tray/tray_constants.h" | 25 #include "ash/system/tray/tray_constants.h" |
26 #include "ash/system/tray_accessibility.h" | 26 #include "ash/system/tray_accessibility.h" |
27 #include "ash/system/tray_caps_lock.h" | 27 #include "ash/system/tray_caps_lock.h" |
| 28 #include "ash/system/tray_locale.h" |
28 #include "ash/system/tray_update.h" | 29 #include "ash/system/tray_update.h" |
29 #include "ash/system/user/login_status.h" | 30 #include "ash/system/user/login_status.h" |
30 #include "ash/system/user/tray_user.h" | 31 #include "ash/system/user/tray_user.h" |
31 #include "ash/wm/shelf_layout_manager.h" | 32 #include "ash/wm/shelf_layout_manager.h" |
32 #include "base/i18n/rtl.h" | 33 #include "base/i18n/rtl.h" |
33 #include "base/logging.h" | 34 #include "base/logging.h" |
34 #include "base/timer.h" | 35 #include "base/timer.h" |
35 #include "base/utf_string_conversions.h" | 36 #include "base/utf_string_conversions.h" |
36 #include "grit/ash_strings.h" | 37 #include "grit/ash_strings.h" |
37 #include "ui/aura/root_window.h" | 38 #include "ui/aura/root_window.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 SystemTray::SystemTray() | 155 SystemTray::SystemTray() |
155 : items_(), | 156 : items_(), |
156 accessibility_observer_(NULL), | 157 accessibility_observer_(NULL), |
157 audio_observer_(NULL), | 158 audio_observer_(NULL), |
158 bluetooth_observer_(NULL), | 159 bluetooth_observer_(NULL), |
159 brightness_observer_(NULL), | 160 brightness_observer_(NULL), |
160 caps_lock_observer_(NULL), | 161 caps_lock_observer_(NULL), |
161 clock_observer_(NULL), | 162 clock_observer_(NULL), |
162 drive_observer_(NULL), | 163 drive_observer_(NULL), |
163 ime_observer_(NULL), | 164 ime_observer_(NULL), |
| 165 locale_observer_(NULL), |
164 network_observer_(NULL), | 166 network_observer_(NULL), |
165 power_status_observer_(NULL), | 167 power_status_observer_(NULL), |
166 update_observer_(NULL), | 168 update_observer_(NULL), |
167 user_observer_(NULL), | 169 user_observer_(NULL), |
168 widget_(NULL), | 170 widget_(NULL), |
169 background_(new internal::SystemTrayBackground), | 171 background_(new internal::SystemTrayBackground), |
170 should_show_launcher_(false), | 172 should_show_launcher_(false), |
171 ALLOW_THIS_IN_INITIALIZER_LIST(hide_background_animator_(this, | 173 ALLOW_THIS_IN_INITIALIZER_LIST(hide_background_animator_(this, |
172 0, kTrayBackgroundAlpha)), | 174 0, kTrayBackgroundAlpha)), |
173 ALLOW_THIS_IN_INITIALIZER_LIST(hover_background_animator_(this, | 175 ALLOW_THIS_IN_INITIALIZER_LIST(hover_background_animator_(this, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 internal::TrayBrightness* tray_brightness = new internal::TrayBrightness(); | 207 internal::TrayBrightness* tray_brightness = new internal::TrayBrightness(); |
206 internal::TrayDate* tray_date = new internal::TrayDate(); | 208 internal::TrayDate* tray_date = new internal::TrayDate(); |
207 internal::TrayPower* tray_power = new internal::TrayPower(); | 209 internal::TrayPower* tray_power = new internal::TrayPower(); |
208 internal::TrayNetwork* tray_network = new internal::TrayNetwork; | 210 internal::TrayNetwork* tray_network = new internal::TrayNetwork; |
209 internal::TrayUser* tray_user = new internal::TrayUser; | 211 internal::TrayUser* tray_user = new internal::TrayUser; |
210 internal::TrayAccessibility* tray_accessibility = | 212 internal::TrayAccessibility* tray_accessibility = |
211 new internal::TrayAccessibility; | 213 new internal::TrayAccessibility; |
212 internal::TrayCapsLock* tray_caps_lock = new internal::TrayCapsLock; | 214 internal::TrayCapsLock* tray_caps_lock = new internal::TrayCapsLock; |
213 internal::TrayDrive* tray_drive = new internal::TrayDrive; | 215 internal::TrayDrive* tray_drive = new internal::TrayDrive; |
214 internal::TrayIME* tray_ime = new internal::TrayIME; | 216 internal::TrayIME* tray_ime = new internal::TrayIME; |
| 217 internal::TrayLocale* tray_locale = new internal::TrayLocale; |
215 internal::TrayUpdate* tray_update = new internal::TrayUpdate; | 218 internal::TrayUpdate* tray_update = new internal::TrayUpdate; |
216 | 219 |
217 accessibility_observer_ = tray_accessibility; | 220 accessibility_observer_ = tray_accessibility; |
218 audio_observer_ = tray_volume; | 221 audio_observer_ = tray_volume; |
219 bluetooth_observer_ = tray_bluetooth; | 222 bluetooth_observer_ = tray_bluetooth; |
220 brightness_observer_ = tray_brightness; | 223 brightness_observer_ = tray_brightness; |
221 caps_lock_observer_ = tray_caps_lock; | 224 caps_lock_observer_ = tray_caps_lock; |
222 clock_observer_ = tray_date; | 225 clock_observer_ = tray_date; |
223 drive_observer_ = tray_drive; | 226 drive_observer_ = tray_drive; |
224 ime_observer_ = tray_ime; | 227 ime_observer_ = tray_ime; |
| 228 locale_observer_ = tray_locale; |
225 network_observer_ = tray_network; | 229 network_observer_ = tray_network; |
226 power_status_observer_ = tray_power; | 230 power_status_observer_ = tray_power; |
227 update_observer_ = tray_update; | 231 update_observer_ = tray_update; |
228 user_observer_ = tray_user; | 232 user_observer_ = tray_user; |
229 | 233 |
230 AddTrayItem(tray_user); | 234 AddTrayItem(tray_user); |
231 AddTrayItem(tray_power); | 235 AddTrayItem(tray_power); |
232 AddTrayItem(tray_network); | 236 AddTrayItem(tray_network); |
233 AddTrayItem(tray_bluetooth); | 237 AddTrayItem(tray_bluetooth); |
234 AddTrayItem(tray_drive); | 238 AddTrayItem(tray_drive); |
235 AddTrayItem(tray_ime); | 239 AddTrayItem(tray_ime); |
| 240 AddTrayItem(tray_locale); |
236 AddTrayItem(tray_volume); | 241 AddTrayItem(tray_volume); |
237 AddTrayItem(tray_brightness); | 242 AddTrayItem(tray_brightness); |
238 AddTrayItem(tray_update); | 243 AddTrayItem(tray_update); |
239 AddTrayItem(tray_accessibility); | 244 AddTrayItem(tray_accessibility); |
240 AddTrayItem(tray_caps_lock); | 245 AddTrayItem(tray_caps_lock); |
241 AddTrayItem(new internal::TraySettings()); | 246 AddTrayItem(new internal::TraySettings()); |
242 AddTrayItem(tray_date); | 247 AddTrayItem(tray_date); |
243 SetVisible(ash::Shell::GetInstance()->tray_delegate()-> | 248 SetVisible(ash::Shell::GetInstance()->tray_delegate()-> |
244 GetTrayVisibilityOnStartup()); | 249 GetTrayVisibilityOnStartup()); |
245 } | 250 } |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 canvas->DrawFocusRect(tray_container_->bounds()); | 536 canvas->DrawFocusRect(tray_container_->bounds()); |
532 } | 537 } |
533 | 538 |
534 void SystemTray::UpdateBackground(int alpha) { | 539 void SystemTray::UpdateBackground(int alpha) { |
535 background_->set_alpha(hide_background_animator_.alpha() + | 540 background_->set_alpha(hide_background_animator_.alpha() + |
536 hover_background_animator_.alpha()); | 541 hover_background_animator_.alpha()); |
537 SchedulePaint(); | 542 SchedulePaint(); |
538 } | 543 } |
539 | 544 |
540 } // namespace ash | 545 } // namespace ash |
OLD | NEW |