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/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shelf/shelf_widget.h" | 9 #include "ash/shelf/shelf_widget.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 browser_widget->Show(); | 308 browser_widget->Show(); |
309 | 309 |
310 aura::Window* browser_window = browser_widget->GetNativeView(); | 310 aura::Window* browser_window = browser_widget->GetNativeView(); |
311 | 311 |
312 views::View* root_view = browser_widget->GetRootView(); | 312 views::View* root_view = browser_widget->GetRootView(); |
313 | 313 |
314 views::AccessiblePaneView* pane1 = new views::AccessiblePaneView(); | 314 views::AccessiblePaneView* pane1 = new views::AccessiblePaneView(); |
315 root_view->AddChildView(pane1); | 315 root_view->AddChildView(pane1); |
316 | 316 |
317 views::View* view1 = new views::View; | 317 views::View* view1 = new views::View; |
318 view1->set_focusable(true); | 318 view1->SetFocusable(true); |
319 pane1->AddChildView(view1); | 319 pane1->AddChildView(view1); |
320 | 320 |
321 views::View* view2 = new views::View; | 321 views::View* view2 = new views::View; |
322 view2->set_focusable(true); | 322 view2->SetFocusable(true); |
323 pane1->AddChildView(view2); | 323 pane1->AddChildView(view2); |
324 | 324 |
325 views::AccessiblePaneView* pane2 = new views::AccessiblePaneView(); | 325 views::AccessiblePaneView* pane2 = new views::AccessiblePaneView(); |
326 root_view->AddChildView(pane2); | 326 root_view->AddChildView(pane2); |
327 | 327 |
328 views::View* view3 = new views::View; | 328 views::View* view3 = new views::View; |
329 view3->set_focusable(true); | 329 view3->SetFocusable(true); |
330 pane2->AddChildView(view3); | 330 pane2->AddChildView(view3); |
331 | 331 |
332 views::View* view4 = new views::View; | 332 views::View* view4 = new views::View; |
333 view4->set_focusable(true); | 333 view4->SetFocusable(true); |
334 pane2->AddChildView(view4); | 334 pane2->AddChildView(view4); |
335 | 335 |
336 std::vector<views::View*> panes; | 336 std::vector<views::View*> panes; |
337 panes.push_back(pane1); | 337 panes.push_back(pane1); |
338 panes.push_back(pane2); | 338 panes.push_back(pane2); |
339 | 339 |
340 test_widget_delegate->SetAccessiblePanes(panes); | 340 test_widget_delegate->SetAccessiblePanes(panes); |
341 | 341 |
342 views::FocusManager* focus_manager = browser_widget->GetFocusManager(); | 342 views::FocusManager* focus_manager = browser_widget->GetFocusManager(); |
343 | 343 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // should do the same thing. | 393 // should do the same thing. |
394 focus_cycler()->RotateFocus(FocusCycler::BACKWARD); | 394 focus_cycler()->RotateFocus(FocusCycler::BACKWARD); |
395 EXPECT_TRUE(shelf_widget()->IsActive()); | 395 EXPECT_TRUE(shelf_widget()->IsActive()); |
396 event_generator.PressKey(ui::VKEY_ESCAPE, 0); | 396 event_generator.PressKey(ui::VKEY_ESCAPE, 0); |
397 EXPECT_TRUE(wm::IsActiveWindow(browser_window)); | 397 EXPECT_TRUE(wm::IsActiveWindow(browser_window)); |
398 EXPECT_EQ(focus_manager->GetFocusedView(), view1); | 398 EXPECT_EQ(focus_manager->GetFocusedView(), view1); |
399 } | 399 } |
400 | 400 |
401 } // namespace test | 401 } // namespace test |
402 } // namespace ash | 402 } // namespace ash |
OLD | NEW |