Roll src/third_party/WebKit dbf9be3:8d6c3d5 (svn 202308:202312)
[chromium-blink-merge.git] / ash / test / status_area_widget_test_helper.cc
blob8e7768f5092a6579af78df33d3a048518c2a580c
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.
5 #include "ash/test/status_area_widget_test_helper.h"
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"
13 namespace ash {
15 user::LoginStatus StatusAreaWidgetTestHelper::GetUserLoginStatus() {
16 return Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus();
19 StatusAreaWidget* StatusAreaWidgetTestHelper::GetStatusAreaWidget() {
20 return Shell::GetPrimaryRootWindowController()->shelf()->
21 status_area_widget();
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();
34 return NULL;
37 } // namespace ash