| 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 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "ash/common/system/ime/tray_ime_chromeos.h" | 37 #include "ash/common/system/ime/tray_ime_chromeos.h" |
| 38 #include "ash/common/system/tiles/tray_tiles.h" | 38 #include "ash/common/system/tiles/tray_tiles.h" |
| 39 #include "ash/common/system/tray/system_tray_controller.h" | 39 #include "ash/common/system/tray/system_tray_controller.h" |
| 40 #include "ash/common/system/tray/system_tray_delegate.h" | 40 #include "ash/common/system/tray/system_tray_delegate.h" |
| 41 #include "ash/common/system/tray/system_tray_item.h" | 41 #include "ash/common/system/tray/system_tray_item.h" |
| 42 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 42 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
| 43 #include "ash/common/system/tray/tray_constants.h" | 43 #include "ash/common/system/tray/tray_constants.h" |
| 44 #include "ash/common/system/tray_accessibility.h" | 44 #include "ash/common/system/tray_accessibility.h" |
| 45 #include "ash/common/system/update/tray_update.h" | 45 #include "ash/common/system/update/tray_update.h" |
| 46 #include "ash/common/system/user/tray_user.h" | 46 #include "ash/common/system/user/tray_user.h" |
| 47 #include "ash/common/system/user/tray_user_separator.h" | |
| 48 #include "ash/common/system/web_notification/web_notification_tray.h" | 47 #include "ash/common/system/web_notification/web_notification_tray.h" |
| 49 #include "ash/common/wm/container_finder.h" | 48 #include "ash/common/wm/container_finder.h" |
| 50 #include "ash/common/wm_activation_observer.h" | 49 #include "ash/common/wm_activation_observer.h" |
| 51 #include "ash/common/wm_lookup.h" | 50 #include "ash/common/wm_lookup.h" |
| 52 #include "ash/common/wm_shell.h" | 51 #include "ash/common/wm_shell.h" |
| 53 #include "ash/common/wm_window.h" | 52 #include "ash/common/wm_window.h" |
| 54 #include "ash/public/cpp/shell_window_ids.h" | 53 #include "ash/public/cpp/shell_window_ids.h" |
| 55 #include "ash/root_window_controller.h" | 54 #include "ash/root_window_controller.h" |
| 56 #include "base/logging.h" | 55 #include "base/logging.h" |
| 57 #include "base/memory/ptr_util.h" | 56 #include "base/memory/ptr_util.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 259 |
| 261 // Create user items for each possible user. | 260 // Create user items for each possible user. |
| 262 int maximum_user_profiles = WmShell::Get() | 261 int maximum_user_profiles = WmShell::Get() |
| 263 ->GetSessionStateDelegate() | 262 ->GetSessionStateDelegate() |
| 264 ->GetMaximumNumberOfLoggedInUsers(); | 263 ->GetMaximumNumberOfLoggedInUsers(); |
| 265 for (int i = 0; i < maximum_user_profiles; i++) | 264 for (int i = 0; i < maximum_user_profiles; i++) |
| 266 AddTrayItem(base::MakeUnique<TrayUser>(this, i)); | 265 AddTrayItem(base::MakeUnique<TrayUser>(this, i)); |
| 267 | 266 |
| 268 // Crucially, this trailing padding has to be inside the user item(s). | 267 // Crucially, this trailing padding has to be inside the user item(s). |
| 269 // Otherwise it could be a main axis margin on the tray's box layout. | 268 // Otherwise it could be a main axis margin on the tray's box layout. |
| 270 if (use_md) | 269 AddTrayItem(base::MakeUnique<PaddingTrayItem>()); |
| 271 AddTrayItem(base::MakeUnique<PaddingTrayItem>()); | |
| 272 | |
| 273 if (!use_md && maximum_user_profiles > 1) { | |
| 274 // Add a special double line separator between users and the rest of the | |
| 275 // menu if more than one user is logged in. | |
| 276 AddTrayItem(base::MakeUnique<TrayUserSeparator>(this)); | |
| 277 } | |
| 278 | 270 |
| 279 tray_accessibility_ = new TrayAccessibility(this); | 271 tray_accessibility_ = new TrayAccessibility(this); |
| 280 if (!use_md) | 272 if (!use_md) |
| 281 tray_date_ = new TrayDate(this); | 273 tray_date_ = new TrayDate(this); |
| 282 tray_update_ = new TrayUpdate(this); | 274 tray_update_ = new TrayUpdate(this); |
| 283 | 275 |
| 284 AddTrayItem(base::MakeUnique<TraySessionLengthLimit>(this)); | 276 AddTrayItem(base::MakeUnique<TraySessionLengthLimit>(this)); |
| 285 AddTrayItem(base::MakeUnique<TrayEnterprise>(this)); | 277 AddTrayItem(base::MakeUnique<TrayEnterprise>(this)); |
| 286 AddTrayItem(base::MakeUnique<TraySupervisedUser>(this)); | 278 AddTrayItem(base::MakeUnique<TraySupervisedUser>(this)); |
| 287 AddTrayItem(base::MakeUnique<TrayIME>(this)); | 279 AddTrayItem(base::MakeUnique<TrayIME>(this)); |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 .work_area() | 889 .work_area() |
| 898 .height(); | 890 .height(); |
| 899 if (work_area_height > 0) { | 891 if (work_area_height > 0) { |
| 900 UMA_HISTOGRAM_CUSTOM_COUNTS( | 892 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 901 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 893 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
| 902 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 894 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
| 903 } | 895 } |
| 904 } | 896 } |
| 905 | 897 |
| 906 } // namespace ash | 898 } // namespace ash |
| OLD | NEW |