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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 void SystemTray::Shutdown() { | 260 void SystemTray::Shutdown() { |
261 DCHECK(web_notification_tray_); | 261 DCHECK(web_notification_tray_); |
262 web_notification_tray_ = nullptr; | 262 web_notification_tray_ = nullptr; |
263 } | 263 } |
264 | 264 |
265 void SystemTray::CreateItems(SystemTrayDelegate* delegate) { | 265 void SystemTray::CreateItems(SystemTrayDelegate* delegate) { |
266 const bool use_md = MaterialDesignController::IsSystemTrayMenuMaterial(); | 266 const bool use_md = MaterialDesignController::IsSystemTrayMenuMaterial(); |
267 | 267 |
268 // Create user items for each possible user. | 268 // Create user items for each possible user. |
269 const int maximum_user_profiles = | 269 const int maximum_user_profiles = |
270 WmShell::Get()->session_controller()->GetMaximumNumberOfLoggedInUsers(); | 270 Shell::Get()->session_controller()->GetMaximumNumberOfLoggedInUsers(); |
271 for (int i = 0; i < maximum_user_profiles; i++) | 271 for (int i = 0; i < maximum_user_profiles; i++) |
272 AddTrayItem(base::MakeUnique<TrayUser>(this, i)); | 272 AddTrayItem(base::MakeUnique<TrayUser>(this, i)); |
273 | 273 |
274 // Crucially, this trailing padding has to be inside the user item(s). | 274 // Crucially, this trailing padding has to be inside the user item(s). |
275 // Otherwise it could be a main axis margin on the tray's box layout. | 275 // Otherwise it could be a main axis margin on the tray's box layout. |
276 AddTrayItem(base::MakeUnique<PaddingTrayItem>()); | 276 AddTrayItem(base::MakeUnique<PaddingTrayItem>()); |
277 | 277 |
278 tray_accessibility_ = new TrayAccessibility(this); | 278 tray_accessibility_ = new TrayAccessibility(this); |
279 if (!use_md) | 279 if (!use_md) |
280 tray_date_ = new TrayDate(this); | 280 tray_date_ = new TrayDate(this); |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 .work_area() | 780 .work_area() |
781 .height(); | 781 .height(); |
782 if (work_area_height > 0) { | 782 if (work_area_height > 0) { |
783 UMA_HISTOGRAM_CUSTOM_COUNTS( | 783 UMA_HISTOGRAM_CUSTOM_COUNTS( |
784 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 784 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
785 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 785 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
786 } | 786 } |
787 } | 787 } |
788 | 788 |
789 } // namespace ash | 789 } // namespace ash |
OLD | NEW |