• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "ash/test/status_area_widget_test_helper.h"
6 
7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf_widget.h"
9 #include "ash/shell.h"
10 #include "ash/system/status_area_widget.h"
11 #include "ash/system/tray/system_tray_delegate.h"
12 
13 namespace ash {
14 
GetUserLoginStatus()15 user::LoginStatus StatusAreaWidgetTestHelper::GetUserLoginStatus() {
16   return Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus();
17 }
18 
GetStatusAreaWidget()19 StatusAreaWidget* StatusAreaWidgetTestHelper::GetStatusAreaWidget() {
20   return Shell::GetPrimaryRootWindowController()->shelf()->
21       status_area_widget();
22 }
23 
GetSecondaryStatusAreaWidget()24 StatusAreaWidget* StatusAreaWidgetTestHelper::GetSecondaryStatusAreaWidget() {
25   RootWindowController* primary_controller =
26       Shell::GetPrimaryRootWindowController();
27   Shell::RootWindowControllerList controllers =
28       Shell::GetAllRootWindowControllers();
29   for (size_t i = 0; i < controllers.size(); ++i) {
30     if (controllers[i] != primary_controller)
31       return controllers[i]->shelf()->status_area_widget();
32   }
33 
34   return NULL;
35 }
36 
37 }  // namespace ash
38