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/focus_cycler.h" | 5 #include "ash/focus_cycler.h" |
6 | 6 |
7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 internal::StatusAreaWidgetDelegate* GetStatusAreaWidgetDelegate( | 30 internal::StatusAreaWidgetDelegate* GetStatusAreaWidgetDelegate( |
31 views::Widget* widget) { | 31 views::Widget* widget) { |
32 return static_cast<internal::StatusAreaWidgetDelegate*>( | 32 return static_cast<internal::StatusAreaWidgetDelegate*>( |
33 widget->GetContentsView()); | 33 widget->GetContentsView()); |
34 } | 34 } |
35 | 35 |
36 SystemTray* CreateSystemTray() { | 36 SystemTray* CreateSystemTray() { |
37 SystemTray* tray = new SystemTray; | 37 SystemTray* tray = new SystemTray; |
38 internal::StatusAreaWidget* widget = new internal::StatusAreaWidget; | 38 internal::StatusAreaWidget* widget = new internal::StatusAreaWidget; |
39 widget->AddTray(tray); | 39 widget->AddSystemTray(tray, NULL); |
40 widget->Show(); | 40 widget->Show(); |
41 return tray; | 41 return tray; |
42 } | 42 } |
43 | 43 |
44 } // namespace | 44 } // namespace |
45 | 45 |
46 typedef AshTestBase FocusCyclerTest; | 46 typedef AshTestBase FocusCyclerTest; |
47 | 47 |
48 TEST_F(FocusCyclerTest, CycleFocusBrowserOnly) { | 48 TEST_F(FocusCyclerTest, CycleFocusBrowserOnly) { |
49 scoped_ptr<FocusCycler> focus_cycler(new FocusCycler()); | 49 scoped_ptr<FocusCycler> focus_cycler(new FocusCycler()); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 focus_cycler->RotateFocus(FocusCycler::BACKWARD); | 231 focus_cycler->RotateFocus(FocusCycler::BACKWARD); |
232 EXPECT_TRUE(tray->GetWidget()->IsActive()); | 232 EXPECT_TRUE(tray->GetWidget()->IsActive()); |
233 | 233 |
234 // Cycle focus to the browser | 234 // Cycle focus to the browser |
235 focus_cycler->RotateFocus(FocusCycler::BACKWARD); | 235 focus_cycler->RotateFocus(FocusCycler::BACKWARD); |
236 EXPECT_TRUE(wm::IsActiveWindow(window0.get())); | 236 EXPECT_TRUE(wm::IsActiveWindow(window0.get())); |
237 } | 237 } |
238 | 238 |
239 } // namespace test | 239 } // namespace test |
240 } // namespace ash | 240 } // namespace ash |
OLD | NEW |