| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/key_event_watcher.h" | 11 #include "ash/key_event_watcher.h" |
| 12 #include "ash/login_status.h" | 12 #include "ash/login_status.h" |
| 13 #include "ash/public/cpp/shell_window_ids.h" | 13 #include "ash/public/cpp/shell_window_ids.h" |
| 14 #include "ash/root_window_controller.h" | 14 #include "ash/root_window_controller.h" |
| 15 #include "ash/session/session_controller.h" | 15 #include "ash/session/session_controller.h" |
| 16 #include "ash/shelf/wm_shelf.h" | 16 #include "ash/shelf/wm_shelf.h" |
| 17 #include "ash/shell.h" | 17 #include "ash/shell.h" |
| 18 #include "ash/shell_port.h" | 18 #include "ash/shell_port.h" |
| 19 #include "ash/strings/grit/ash_strings.h" | 19 #include "ash/strings/grit/ash_strings.h" |
| 20 #include "ash/system/audio/tray_audio.h" | 20 #include "ash/system/audio/tray_audio.h" |
| 21 #include "ash/system/bluetooth/tray_bluetooth.h" | 21 #include "ash/system/bluetooth/tray_bluetooth.h" |
| 22 #include "ash/system/brightness/tray_brightness.h" | 22 #include "ash/system/brightness/tray_brightness.h" |
| 23 #include "ash/system/cast/tray_cast.h" | 23 #include "ash/system/cast/tray_cast.h" |
| 24 #include "ash/system/date/tray_system_info.h" | 24 #include "ash/system/date/tray_system_info.h" |
| 25 #include "ash/system/display_scale/tray_scale.h" |
| 25 #include "ash/system/enterprise/tray_enterprise.h" | 26 #include "ash/system/enterprise/tray_enterprise.h" |
| 26 #include "ash/system/ime/tray_ime_chromeos.h" | 27 #include "ash/system/ime/tray_ime_chromeos.h" |
| 27 #include "ash/system/media_security/multi_profile_media_tray_item.h" | 28 #include "ash/system/media_security/multi_profile_media_tray_item.h" |
| 28 #include "ash/system/network/tray_network.h" | 29 #include "ash/system/network/tray_network.h" |
| 29 #include "ash/system/network/tray_vpn.h" | 30 #include "ash/system/network/tray_vpn.h" |
| 30 #include "ash/system/night_light/tray_night_light.h" | 31 #include "ash/system/night_light/tray_night_light.h" |
| 31 #include "ash/system/power/power_status.h" | 32 #include "ash/system/power/power_status.h" |
| 32 #include "ash/system/power/tray_power.h" | 33 #include "ash/system/power/tray_power.h" |
| 33 #include "ash/system/screen_security/screen_capture_tray_item.h" | 34 #include "ash/system/screen_security/screen_capture_tray_item.h" |
| 34 #include "ash/system/screen_security/screen_share_tray_item.h" | 35 #include "ash/system/screen_security/screen_share_tray_item.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 AddTrayItem(base::MakeUnique<TrayBluetooth>(this)); | 266 AddTrayItem(base::MakeUnique<TrayBluetooth>(this)); |
| 266 tray_cast_ = new TrayCast(this); | 267 tray_cast_ = new TrayCast(this); |
| 267 AddTrayItem(base::WrapUnique(tray_cast_)); | 268 AddTrayItem(base::WrapUnique(tray_cast_)); |
| 268 screen_capture_tray_item_ = new ScreenCaptureTrayItem(this); | 269 screen_capture_tray_item_ = new ScreenCaptureTrayItem(this); |
| 269 AddTrayItem(base::WrapUnique(screen_capture_tray_item_)); | 270 AddTrayItem(base::WrapUnique(screen_capture_tray_item_)); |
| 270 screen_share_tray_item_ = new ScreenShareTrayItem(this); | 271 screen_share_tray_item_ = new ScreenShareTrayItem(this); |
| 271 AddTrayItem(base::WrapUnique(screen_share_tray_item_)); | 272 AddTrayItem(base::WrapUnique(screen_share_tray_item_)); |
| 272 AddTrayItem(base::MakeUnique<MultiProfileMediaTrayItem>(this)); | 273 AddTrayItem(base::MakeUnique<MultiProfileMediaTrayItem>(this)); |
| 273 tray_audio_ = new TrayAudio(this); | 274 tray_audio_ = new TrayAudio(this); |
| 274 AddTrayItem(base::WrapUnique(tray_audio_)); | 275 AddTrayItem(base::WrapUnique(tray_audio_)); |
| 276 tray_scale_ = new TrayScale(this); |
| 277 AddTrayItem(base::WrapUnique(tray_scale_)); |
| 275 AddTrayItem(base::MakeUnique<TrayBrightness>(this)); | 278 AddTrayItem(base::MakeUnique<TrayBrightness>(this)); |
| 276 AddTrayItem(base::MakeUnique<TrayCapsLock>(this)); | 279 AddTrayItem(base::MakeUnique<TrayCapsLock>(this)); |
| 277 tray_night_light_ = new TrayNightLight(this); | 280 tray_night_light_ = new TrayNightLight(this); |
| 278 AddTrayItem(base::WrapUnique(tray_night_light_)); | 281 AddTrayItem(base::WrapUnique(tray_night_light_)); |
| 279 // TODO(jamescook): Remove this when mus has support for display management | 282 // TODO(jamescook): Remove this when mus has support for display management |
| 280 // and we have a DisplayManager equivalent. See http://crbug.com/548429 | 283 // and we have a DisplayManager equivalent. See http://crbug.com/548429 |
| 281 std::unique_ptr<SystemTrayItem> tray_rotation_lock = | 284 std::unique_ptr<SystemTrayItem> tray_rotation_lock = |
| 282 delegate->CreateRotationLockTrayItem(this); | 285 delegate->CreateRotationLockTrayItem(this); |
| 283 if (tray_rotation_lock) | 286 if (tray_rotation_lock) |
| 284 AddTrayItem(std::move(tray_rotation_lock)); | 287 AddTrayItem(std::move(tray_rotation_lock)); |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 .work_area() | 720 .work_area() |
| 718 .height(); | 721 .height(); |
| 719 if (work_area_height > 0) { | 722 if (work_area_height > 0) { |
| 720 UMA_HISTOGRAM_CUSTOM_COUNTS( | 723 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 721 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 724 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
| 722 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 725 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
| 723 } | 726 } |
| 724 } | 727 } |
| 725 | 728 |
| 726 } // namespace ash | 729 } // namespace ash |
| OLD | NEW |