forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatus_area_widget_test_helper.cc
35 lines (27 loc) · 1.1 KB
/
status_area_widget_test_helper.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/system/status_area_widget_test_helper.h"
#include "ash/root_window_controller.h"
#include "ash/session/session_controller.h"
#include "ash/shell.h"
#include "ash/system/status_area_widget.h"
namespace ash {
LoginStatus StatusAreaWidgetTestHelper::GetUserLoginStatus() {
return Shell::Get()->session_controller()->login_status();
}
StatusAreaWidget* StatusAreaWidgetTestHelper::GetStatusAreaWidget() {
return Shell::GetPrimaryRootWindowController()->GetStatusAreaWidget();
}
StatusAreaWidget* StatusAreaWidgetTestHelper::GetSecondaryStatusAreaWidget() {
RootWindowController* primary_controller =
Shell::GetPrimaryRootWindowController();
Shell::RootWindowControllerList controllers =
Shell::GetAllRootWindowControllers();
for (size_t i = 0; i < controllers.size(); ++i) {
if (controllers[i] != primary_controller)
return controllers[i]->GetStatusAreaWidget();
}
return nullptr;
}
} // namespace ash