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/common/system/tray/system_tray.h" | 5 #include "ash/common/system/tray/system_tray.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ash/common/key_event_watcher.h" | 11 #include "ash/common/key_event_watcher.h" |
12 #include "ash/common/login_status.h" | 12 #include "ash/common/login_status.h" |
13 #include "ash/common/material_design/material_design_controller.h" | 13 #include "ash/common/material_design/material_design_controller.h" |
14 #include "ash/common/session/session_controller.h" | 14 #include "ash/common/session/session_controller.h" |
15 #include "ash/common/shelf/wm_shelf.h" | 15 #include "ash/common/shelf/wm_shelf.h" |
16 #include "ash/common/shelf/wm_shelf_util.h" | 16 #include "ash/common/shelf/wm_shelf_util.h" |
17 #include "ash/common/system/chromeos/audio/tray_audio.h" | 17 #include "ash/common/system/chromeos/audio/tray_audio.h" |
18 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth.h" | 18 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth.h" |
19 #include "ash/common/system/chromeos/brightness/tray_brightness.h" | 19 #include "ash/common/system/chromeos/brightness/tray_brightness.h" |
20 #include "ash/common/system/chromeos/cast/tray_cast.h" | 20 #include "ash/common/system/chromeos/cast/tray_cast.h" |
21 #include "ash/common/system/chromeos/enterprise/tray_enterprise.h" | 21 #include "ash/common/system/chromeos/enterprise/tray_enterprise.h" |
22 #include "ash/common/system/chromeos/media_security/multi_profile_media_tray_ite
m.h" | 22 #include "ash/common/system/chromeos/media_security/multi_profile_media_tray_ite
m.h" |
23 #include "ash/common/system/chromeos/network/tray_network.h" | 23 #include "ash/common/system/chromeos/network/tray_network.h" |
24 #include "ash/common/system/chromeos/network/tray_vpn.h" | 24 #include "ash/common/system/chromeos/network/tray_vpn.h" |
25 #include "ash/common/system/chromeos/power/power_status.h" | 25 #include "ash/common/system/chromeos/power/power_status.h" |
26 #include "ash/common/system/chromeos/power/tray_power.h" | 26 #include "ash/common/system/chromeos/power/tray_power.h" |
27 #include "ash/common/system/chromeos/screen_security/screen_capture_tray_item.h" | 27 #include "ash/common/system/chromeos/screen_security/screen_capture_tray_item.h" |
28 #include "ash/common/system/chromeos/screen_security/screen_share_tray_item.h" | 28 #include "ash/common/system/chromeos/screen_security/screen_share_tray_item.h" |
29 #include "ash/common/system/chromeos/session/tray_session_length_limit.h" | 29 #include "ash/common/system/chromeos/session/tray_session_length_limit.h" |
30 #include "ash/common/system/chromeos/settings/tray_settings.h" | |
31 #include "ash/common/system/chromeos/supervised/tray_supervised_user.h" | 30 #include "ash/common/system/chromeos/supervised/tray_supervised_user.h" |
32 #include "ash/common/system/chromeos/tray_caps_lock.h" | 31 #include "ash/common/system/chromeos/tray_caps_lock.h" |
33 #include "ash/common/system/chromeos/tray_tracing.h" | 32 #include "ash/common/system/chromeos/tray_tracing.h" |
34 #include "ash/common/system/date/tray_date.h" | 33 #include "ash/common/system/date/tray_date.h" |
35 #include "ash/common/system/date/tray_system_info.h" | 34 #include "ash/common/system/date/tray_system_info.h" |
36 #include "ash/common/system/ime/tray_ime_chromeos.h" | 35 #include "ash/common/system/ime/tray_ime_chromeos.h" |
37 #include "ash/common/system/tiles/tray_tiles.h" | 36 #include "ash/common/system/tiles/tray_tiles.h" |
38 #include "ash/common/system/tray/system_tray_controller.h" | 37 #include "ash/common/system/tray/system_tray_controller.h" |
39 #include "ash/common/system/tray/system_tray_delegate.h" | 38 #include "ash/common/system/tray/system_tray_delegate.h" |
40 #include "ash/common/system/tray/system_tray_item.h" | 39 #include "ash/common/system/tray/system_tray_item.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 tray_audio_ = new TrayAudio(this); | 301 tray_audio_ = new TrayAudio(this); |
303 AddTrayItem(base::WrapUnique(tray_audio_)); | 302 AddTrayItem(base::WrapUnique(tray_audio_)); |
304 AddTrayItem(base::MakeUnique<TrayBrightness>(this)); | 303 AddTrayItem(base::MakeUnique<TrayBrightness>(this)); |
305 AddTrayItem(base::MakeUnique<TrayCapsLock>(this)); | 304 AddTrayItem(base::MakeUnique<TrayCapsLock>(this)); |
306 // TODO(jamescook): Remove this when mus has support for display management | 305 // TODO(jamescook): Remove this when mus has support for display management |
307 // and we have a DisplayManager equivalent. See http://crbug.com/548429 | 306 // and we have a DisplayManager equivalent. See http://crbug.com/548429 |
308 std::unique_ptr<SystemTrayItem> tray_rotation_lock = | 307 std::unique_ptr<SystemTrayItem> tray_rotation_lock = |
309 delegate->CreateRotationLockTrayItem(this); | 308 delegate->CreateRotationLockTrayItem(this); |
310 if (tray_rotation_lock) | 309 if (tray_rotation_lock) |
311 AddTrayItem(std::move(tray_rotation_lock)); | 310 AddTrayItem(std::move(tray_rotation_lock)); |
312 if (!use_md) | |
313 AddTrayItem(base::MakeUnique<TraySettings>(this)); | |
314 AddTrayItem(base::WrapUnique(tray_update_)); | 311 AddTrayItem(base::WrapUnique(tray_update_)); |
315 if (use_md) { | 312 if (use_md) { |
316 tray_tiles_ = new TrayTiles(this); | 313 tray_tiles_ = new TrayTiles(this); |
317 AddTrayItem(base::WrapUnique(tray_tiles_)); | 314 AddTrayItem(base::WrapUnique(tray_tiles_)); |
318 tray_system_info_ = new TraySystemInfo(this); | 315 tray_system_info_ = new TraySystemInfo(this); |
319 AddTrayItem(base::WrapUnique(tray_system_info_)); | 316 AddTrayItem(base::WrapUnique(tray_system_info_)); |
320 // Leading padding. | 317 // Leading padding. |
321 AddTrayItem(base::MakeUnique<PaddingTrayItem>()); | 318 AddTrayItem(base::MakeUnique<PaddingTrayItem>()); |
322 } else { | 319 } else { |
323 AddTrayItem(base::WrapUnique(tray_date_)); | 320 AddTrayItem(base::WrapUnique(tray_date_)); |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 .work_area() | 777 .work_area() |
781 .height(); | 778 .height(); |
782 if (work_area_height > 0) { | 779 if (work_area_height > 0) { |
783 UMA_HISTOGRAM_CUSTOM_COUNTS( | 780 UMA_HISTOGRAM_CUSTOM_COUNTS( |
784 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 781 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
785 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 782 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
786 } | 783 } |
787 } | 784 } |
788 | 785 |
789 } // namespace ash | 786 } // namespace ash |
OLD | NEW |