OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/system/tray/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
| 9 #include "ash/root_window_controller.h" |
9 #include "ash/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
10 #include "ash/system/tray/system_tray_item.h" | 11 #include "ash/system/tray/system_tray_item.h" |
11 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
12 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
13 #include "ui/views/controls/label.h" | 14 #include "ui/views/controls/label.h" |
14 #include "ui/views/layout/fill_layout.h" | 15 #include "ui/views/layout/fill_layout.h" |
15 #include "ui/views/view.h" | 16 #include "ui/views/view.h" |
16 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
17 | 18 |
18 namespace ash { | 19 namespace ash { |
19 namespace test { | 20 namespace test { |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 SystemTray* GetSystemTray() { | 24 SystemTray* GetSystemTray() { |
24 return Shell::GetInstance()->status_area_widget()->system_tray(); | 25 return Shell::GetPrimaryRootWindowController()->status_area_widget()-> |
| 26 system_tray(); |
25 } | 27 } |
26 | 28 |
27 // Trivial item implementation that tracks its views for testing. | 29 // Trivial item implementation that tracks its views for testing. |
28 class TestItem : public SystemTrayItem { | 30 class TestItem : public SystemTrayItem { |
29 public: | 31 public: |
30 TestItem() : tray_view_(NULL) {} | 32 TestItem() : tray_view_(NULL) {} |
31 | 33 |
32 virtual views::View* CreateTrayView(user::LoginStatus status) { | 34 virtual views::View* CreateTrayView(user::LoginStatus status) { |
33 tray_view_ = new views::View; | 35 tray_view_ = new views::View; |
34 // Add a label so it has non-zero width. | 36 // Add a label so it has non-zero width. |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 tray->ShowDefaultView(BUBBLE_USE_EXISTING); | 229 tray->ShowDefaultView(BUBBLE_USE_EXISTING); |
228 RunAllPendingInMessageLoop(); | 230 RunAllPendingInMessageLoop(); |
229 | 231 |
230 EXPECT_EQ(bubble_bounds.ToString(), test_item->default_view()->GetWidget()-> | 232 EXPECT_EQ(bubble_bounds.ToString(), test_item->default_view()->GetWidget()-> |
231 GetWindowBoundsInScreen().ToString()); | 233 GetWindowBoundsInScreen().ToString()); |
232 EXPECT_EQ(widget, test_item->default_view()->GetWidget()); | 234 EXPECT_EQ(widget, test_item->default_view()->GetWidget()); |
233 } | 235 } |
234 | 236 |
235 } // namespace test | 237 } // namespace test |
236 } // namespace ash | 238 } // namespace ash |
OLD | NEW |