Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(790)

Side by Side Diff: ash/test/status_area_widget_test_helper.cc

Issue 2304443002: ash: Move ShelfWidget ownership to WmShelf and refactor access to it (Closed)
Patch Set: review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shell/window_type_launcher.cc ('k') | ash/wm/overview/window_selector_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/shelf/shelf_widget.h"
8 #include "ash/common/system/status_area_widget.h" 7 #include "ash/common/system/status_area_widget.h"
9 #include "ash/common/system/tray/system_tray_delegate.h" 8 #include "ash/common/system/tray/system_tray_delegate.h"
10 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
11 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
12 #include "ash/shell.h" 11 #include "ash/shell.h"
13 12
14 namespace ash { 13 namespace ash {
15 14
16 LoginStatus StatusAreaWidgetTestHelper::GetUserLoginStatus() { 15 LoginStatus StatusAreaWidgetTestHelper::GetUserLoginStatus() {
17 return WmShell::Get()->system_tray_delegate()->GetUserLoginStatus(); 16 return WmShell::Get()->system_tray_delegate()->GetUserLoginStatus();
18 } 17 }
19 18
20 StatusAreaWidget* StatusAreaWidgetTestHelper::GetStatusAreaWidget() { 19 StatusAreaWidget* StatusAreaWidgetTestHelper::GetStatusAreaWidget() {
21 return Shell::GetPrimaryRootWindowController() 20 return Shell::GetPrimaryRootWindowController()->GetStatusAreaWidget();
22 ->shelf_widget()
23 ->status_area_widget();
24 } 21 }
25 22
26 StatusAreaWidget* StatusAreaWidgetTestHelper::GetSecondaryStatusAreaWidget() { 23 StatusAreaWidget* StatusAreaWidgetTestHelper::GetSecondaryStatusAreaWidget() {
27 RootWindowController* primary_controller = 24 RootWindowController* primary_controller =
28 Shell::GetPrimaryRootWindowController(); 25 Shell::GetPrimaryRootWindowController();
29 Shell::RootWindowControllerList controllers = 26 Shell::RootWindowControllerList controllers =
30 Shell::GetAllRootWindowControllers(); 27 Shell::GetAllRootWindowControllers();
31 for (size_t i = 0; i < controllers.size(); ++i) { 28 for (size_t i = 0; i < controllers.size(); ++i) {
32 if (controllers[i] != primary_controller) 29 if (controllers[i] != primary_controller)
33 return controllers[i]->shelf_widget()->status_area_widget(); 30 return controllers[i]->GetStatusAreaWidget();
34 } 31 }
35 32
36 return NULL; 33 return nullptr;
37 } 34 }
38 35
39 } // namespace ash 36 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/window_type_launcher.cc ('k') | ash/wm/overview/window_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698