| 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/enterprise/tray_enterprise.h" | 25 #include "ash/system/enterprise/tray_enterprise.h" |
| 26 #include "ash/system/fractional_view/tray_scale.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/power/power_status.h" | 31 #include "ash/system/power/power_status.h" |
| 31 #include "ash/system/power/tray_power.h" | 32 #include "ash/system/power/tray_power.h" |
| 32 #include "ash/system/screen_security/screen_capture_tray_item.h" | 33 #include "ash/system/screen_security/screen_capture_tray_item.h" |
| 33 #include "ash/system/screen_security/screen_share_tray_item.h" | 34 #include "ash/system/screen_security/screen_share_tray_item.h" |
| 34 #include "ash/system/session/tray_session_length_limit.h" | 35 #include "ash/system/session/tray_session_length_limit.h" |
| 35 #include "ash/system/supervised/tray_supervised_user.h" | 36 #include "ash/system/supervised/tray_supervised_user.h" |
| 36 #include "ash/system/tiles/tray_tiles.h" | 37 #include "ash/system/tiles/tray_tiles.h" |
| 37 #include "ash/system/tray/system_tray_controller.h" | 38 #include "ash/system/tray/system_tray_controller.h" |
| 38 #include "ash/system/tray/system_tray_delegate.h" | 39 #include "ash/system/tray/system_tray_delegate.h" |
| 39 #include "ash/system/tray/system_tray_item.h" | 40 #include "ash/system/tray/system_tray_item.h" |
| 40 #include "ash/system/tray/tray_bubble_wrapper.h" | 41 #include "ash/system/tray/tray_bubble_wrapper.h" |
| 41 #include "ash/system/tray/tray_constants.h" | 42 #include "ash/system/tray/tray_constants.h" |
| 42 #include "ash/system/tray/tray_container.h" | 43 #include "ash/system/tray/tray_container.h" |
| 43 #include "ash/system/tray_accessibility.h" | 44 #include "ash/system/tray_accessibility.h" |
| 44 #include "ash/system/tray_caps_lock.h" | 45 #include "ash/system/tray_caps_lock.h" |
| 45 #include "ash/system/tray_tracing.h" | 46 #include "ash/system/tray_tracing.h" |
| 46 #include "ash/system/update/tray_update.h" | 47 #include "ash/system/update/tray_update.h" |
| 47 #include "ash/system/user/tray_user.h" | 48 #include "ash/system/user/tray_user.h" |
| 48 #include "ash/system/web_notification/web_notification_tray.h" | 49 #include "ash/system/web_notification/web_notification_tray.h" |
| 49 #include "ash/wm/container_finder.h" | 50 #include "ash/wm/container_finder.h" |
| 50 #include "ash/wm/widget_finder.h" | 51 #include "ash/wm/widget_finder.h" |
| 51 #include "ash/wm_window.h" | 52 #include "ash/wm_window.h" |
| 53 #include "base/command_line.h" |
| 52 #include "base/logging.h" | 54 #include "base/logging.h" |
| 53 #include "base/memory/ptr_util.h" | 55 #include "base/memory/ptr_util.h" |
| 54 #include "base/metrics/histogram_macros.h" | 56 #include "base/metrics/histogram_macros.h" |
| 55 #include "base/timer/timer.h" | 57 #include "base/timer/timer.h" |
| 58 #include "chromeos/chromeos_switches.h" |
| 56 #include "ui/base/accelerators/accelerator.h" | 59 #include "ui/base/accelerators/accelerator.h" |
| 57 #include "ui/base/l10n/l10n_util.h" | 60 #include "ui/base/l10n/l10n_util.h" |
| 58 #include "ui/compositor/layer.h" | 61 #include "ui/compositor/layer.h" |
| 59 #include "ui/display/display.h" | 62 #include "ui/display/display.h" |
| 60 #include "ui/display/screen.h" | 63 #include "ui/display/screen.h" |
| 61 #include "ui/events/event_constants.h" | 64 #include "ui/events/event_constants.h" |
| 62 #include "ui/gfx/canvas.h" | 65 #include "ui/gfx/canvas.h" |
| 63 #include "ui/gfx/skia_util.h" | 66 #include "ui/gfx/skia_util.h" |
| 64 #include "ui/message_center/message_center.h" | 67 #include "ui/message_center/message_center.h" |
| 65 #include "ui/message_center/message_center_style.h" | 68 #include "ui/message_center/message_center_style.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 AddTrayItem(base::WrapUnique(tray_cast_)); | 269 AddTrayItem(base::WrapUnique(tray_cast_)); |
| 267 screen_capture_tray_item_ = new ScreenCaptureTrayItem(this); | 270 screen_capture_tray_item_ = new ScreenCaptureTrayItem(this); |
| 268 AddTrayItem(base::WrapUnique(screen_capture_tray_item_)); | 271 AddTrayItem(base::WrapUnique(screen_capture_tray_item_)); |
| 269 screen_share_tray_item_ = new ScreenShareTrayItem(this); | 272 screen_share_tray_item_ = new ScreenShareTrayItem(this); |
| 270 AddTrayItem(base::WrapUnique(screen_share_tray_item_)); | 273 AddTrayItem(base::WrapUnique(screen_share_tray_item_)); |
| 271 AddTrayItem(base::MakeUnique<MultiProfileMediaTrayItem>(this)); | 274 AddTrayItem(base::MakeUnique<MultiProfileMediaTrayItem>(this)); |
| 272 tray_audio_ = new TrayAudio(this); | 275 tray_audio_ = new TrayAudio(this); |
| 273 AddTrayItem(base::WrapUnique(tray_audio_)); | 276 AddTrayItem(base::WrapUnique(tray_audio_)); |
| 274 AddTrayItem(base::MakeUnique<TrayBrightness>(this)); | 277 AddTrayItem(base::MakeUnique<TrayBrightness>(this)); |
| 275 AddTrayItem(base::MakeUnique<TrayCapsLock>(this)); | 278 AddTrayItem(base::MakeUnique<TrayCapsLock>(this)); |
| 279 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 280 chromeos::switches::kEnableScalableViews)) { |
| 281 tray_scale_ = new TrayScale(this); |
| 282 AddTrayItem(base::WrapUnique(tray_scale_)); |
| 283 } |
| 284 |
| 276 // TODO(jamescook): Remove this when mus has support for display management | 285 // TODO(jamescook): Remove this when mus has support for display management |
| 277 // and we have a DisplayManager equivalent. See http://crbug.com/548429 | 286 // and we have a DisplayManager equivalent. See http://crbug.com/548429 |
| 278 std::unique_ptr<SystemTrayItem> tray_rotation_lock = | 287 std::unique_ptr<SystemTrayItem> tray_rotation_lock = |
| 279 delegate->CreateRotationLockTrayItem(this); | 288 delegate->CreateRotationLockTrayItem(this); |
| 280 if (tray_rotation_lock) | 289 if (tray_rotation_lock) |
| 281 AddTrayItem(std::move(tray_rotation_lock)); | 290 AddTrayItem(std::move(tray_rotation_lock)); |
| 282 tray_update_ = new TrayUpdate(this); | 291 tray_update_ = new TrayUpdate(this); |
| 283 AddTrayItem(base::WrapUnique(tray_update_)); | 292 AddTrayItem(base::WrapUnique(tray_update_)); |
| 284 tray_tiles_ = new TrayTiles(this); | 293 tray_tiles_ = new TrayTiles(this); |
| 285 AddTrayItem(base::WrapUnique(tray_tiles_)); | 294 AddTrayItem(base::WrapUnique(tray_tiles_)); |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 .work_area() | 729 .work_area() |
| 721 .height(); | 730 .height(); |
| 722 if (work_area_height > 0) { | 731 if (work_area_height > 0) { |
| 723 UMA_HISTOGRAM_CUSTOM_COUNTS( | 732 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 724 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 733 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
| 725 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 734 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
| 726 } | 735 } |
| 727 } | 736 } |
| 728 | 737 |
| 729 } // namespace ash | 738 } // namespace ash |
| OLD | NEW |