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" |
30 #include "ash/common/system/chromeos/supervised/tray_supervised_user.h" | 31 #include "ash/common/system/chromeos/supervised/tray_supervised_user.h" |
31 #include "ash/common/system/chromeos/tray_caps_lock.h" | 32 #include "ash/common/system/chromeos/tray_caps_lock.h" |
32 #include "ash/common/system/chromeos/tray_tracing.h" | 33 #include "ash/common/system/chromeos/tray_tracing.h" |
33 #include "ash/common/system/date/tray_date.h" | 34 #include "ash/common/system/date/tray_date.h" |
34 #include "ash/common/system/date/tray_system_info.h" | 35 #include "ash/common/system/date/tray_system_info.h" |
35 #include "ash/common/system/ime/tray_ime_chromeos.h" | 36 #include "ash/common/system/ime/tray_ime_chromeos.h" |
36 #include "ash/common/system/tiles/tray_tiles.h" | 37 #include "ash/common/system/tiles/tray_tiles.h" |
37 #include "ash/common/system/tray/system_tray_controller.h" | 38 #include "ash/common/system/tray/system_tray_controller.h" |
38 #include "ash/common/system/tray/system_tray_delegate.h" | 39 #include "ash/common/system/tray/system_tray_delegate.h" |
39 #include "ash/common/system/tray/system_tray_item.h" | 40 #include "ash/common/system/tray/system_tray_item.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 tray_audio_ = new TrayAudio(this); | 302 tray_audio_ = new TrayAudio(this); |
302 AddTrayItem(base::WrapUnique(tray_audio_)); | 303 AddTrayItem(base::WrapUnique(tray_audio_)); |
303 AddTrayItem(base::MakeUnique<TrayBrightness>(this)); | 304 AddTrayItem(base::MakeUnique<TrayBrightness>(this)); |
304 AddTrayItem(base::MakeUnique<TrayCapsLock>(this)); | 305 AddTrayItem(base::MakeUnique<TrayCapsLock>(this)); |
305 // TODO(jamescook): Remove this when mus has support for display management | 306 // TODO(jamescook): Remove this when mus has support for display management |
306 // and we have a DisplayManager equivalent. See http://crbug.com/548429 | 307 // and we have a DisplayManager equivalent. See http://crbug.com/548429 |
307 std::unique_ptr<SystemTrayItem> tray_rotation_lock = | 308 std::unique_ptr<SystemTrayItem> tray_rotation_lock = |
308 delegate->CreateRotationLockTrayItem(this); | 309 delegate->CreateRotationLockTrayItem(this); |
309 if (tray_rotation_lock) | 310 if (tray_rotation_lock) |
310 AddTrayItem(std::move(tray_rotation_lock)); | 311 AddTrayItem(std::move(tray_rotation_lock)); |
| 312 if (!use_md) |
| 313 AddTrayItem(base::MakeUnique<TraySettings>(this)); |
311 AddTrayItem(base::WrapUnique(tray_update_)); | 314 AddTrayItem(base::WrapUnique(tray_update_)); |
312 if (use_md) { | 315 if (use_md) { |
313 tray_tiles_ = new TrayTiles(this); | 316 tray_tiles_ = new TrayTiles(this); |
314 AddTrayItem(base::WrapUnique(tray_tiles_)); | 317 AddTrayItem(base::WrapUnique(tray_tiles_)); |
315 tray_system_info_ = new TraySystemInfo(this); | 318 tray_system_info_ = new TraySystemInfo(this); |
316 AddTrayItem(base::WrapUnique(tray_system_info_)); | 319 AddTrayItem(base::WrapUnique(tray_system_info_)); |
317 // Leading padding. | 320 // Leading padding. |
318 AddTrayItem(base::MakeUnique<PaddingTrayItem>()); | 321 AddTrayItem(base::MakeUnique<PaddingTrayItem>()); |
319 } else { | 322 } else { |
320 AddTrayItem(base::WrapUnique(tray_date_)); | 323 AddTrayItem(base::WrapUnique(tray_date_)); |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 .work_area() | 780 .work_area() |
778 .height(); | 781 .height(); |
779 if (work_area_height > 0) { | 782 if (work_area_height > 0) { |
780 UMA_HISTOGRAM_CUSTOM_COUNTS( | 783 UMA_HISTOGRAM_CUSTOM_COUNTS( |
781 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 784 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
782 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 785 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
783 } | 786 } |
784 } | 787 } |
785 | 788 |
786 } // namespace ash | 789 } // namespace ash |
OLD | NEW |