OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/test/status_area_widget_test_helper.h" | 5 #include "ash/test/status_area_widget_test_helper.h" |
6 | 6 |
7 #include "ash/common/system/status_area_widget.h" | |
8 #include "ash/common/system/tray/system_tray_delegate.h" | |
9 #include "ash/common/wm_shell.h" | 7 #include "ash/common/wm_shell.h" |
10 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
11 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/system/status_area_widget.h" |
| 11 #include "ash/system/tray/system_tray_delegate.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 LoginStatus StatusAreaWidgetTestHelper::GetUserLoginStatus() { | 15 LoginStatus StatusAreaWidgetTestHelper::GetUserLoginStatus() { |
16 return WmShell::Get()->system_tray_delegate()->GetUserLoginStatus(); | 16 return WmShell::Get()->system_tray_delegate()->GetUserLoginStatus(); |
17 } | 17 } |
18 | 18 |
19 StatusAreaWidget* StatusAreaWidgetTestHelper::GetStatusAreaWidget() { | 19 StatusAreaWidget* StatusAreaWidgetTestHelper::GetStatusAreaWidget() { |
20 return Shell::GetPrimaryRootWindowController()->GetStatusAreaWidget(); | 20 return Shell::GetPrimaryRootWindowController()->GetStatusAreaWidget(); |
21 } | 21 } |
22 | 22 |
23 StatusAreaWidget* StatusAreaWidgetTestHelper::GetSecondaryStatusAreaWidget() { | 23 StatusAreaWidget* StatusAreaWidgetTestHelper::GetSecondaryStatusAreaWidget() { |
24 RootWindowController* primary_controller = | 24 RootWindowController* primary_controller = |
25 Shell::GetPrimaryRootWindowController(); | 25 Shell::GetPrimaryRootWindowController(); |
26 Shell::RootWindowControllerList controllers = | 26 Shell::RootWindowControllerList controllers = |
27 Shell::GetAllRootWindowControllers(); | 27 Shell::GetAllRootWindowControllers(); |
28 for (size_t i = 0; i < controllers.size(); ++i) { | 28 for (size_t i = 0; i < controllers.size(); ++i) { |
29 if (controllers[i] != primary_controller) | 29 if (controllers[i] != primary_controller) |
30 return controllers[i]->GetStatusAreaWidget(); | 30 return controllers[i]->GetStatusAreaWidget(); |
31 } | 31 } |
32 | 32 |
33 return nullptr; | 33 return nullptr; |
34 } | 34 } |
35 | 35 |
36 } // namespace ash | 36 } // namespace ash |
OLD | NEW |