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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 browser_widget->Show(); | 311 browser_widget->Show(); |
312 | 312 |
313 aura::Window* browser_window = browser_widget->GetNativeView(); | 313 aura::Window* browser_window = browser_widget->GetNativeView(); |
314 | 314 |
315 views::View* root_view = browser_widget->GetRootView(); | 315 views::View* root_view = browser_widget->GetRootView(); |
316 | 316 |
317 views::AccessiblePaneView* pane1 = new views::AccessiblePaneView(); | 317 views::AccessiblePaneView* pane1 = new views::AccessiblePaneView(); |
318 root_view->AddChildView(pane1); | 318 root_view->AddChildView(pane1); |
319 | 319 |
320 views::View* view1 = new views::View; | 320 views::View* view1 = new views::View; |
321 view1->SetFocusable(true); | 321 view1->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); |
322 pane1->AddChildView(view1); | 322 pane1->AddChildView(view1); |
323 | 323 |
324 views::View* view2 = new views::View; | 324 views::View* view2 = new views::View; |
325 view2->SetFocusable(true); | 325 view2->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); |
326 pane1->AddChildView(view2); | 326 pane1->AddChildView(view2); |
327 | 327 |
328 views::AccessiblePaneView* pane2 = new views::AccessiblePaneView(); | 328 views::AccessiblePaneView* pane2 = new views::AccessiblePaneView(); |
329 root_view->AddChildView(pane2); | 329 root_view->AddChildView(pane2); |
330 | 330 |
331 views::View* view3 = new views::View; | 331 views::View* view3 = new views::View; |
332 view3->SetFocusable(true); | 332 view3->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); |
333 pane2->AddChildView(view3); | 333 pane2->AddChildView(view3); |
334 | 334 |
335 views::View* view4 = new views::View; | 335 views::View* view4 = new views::View; |
336 view4->SetFocusable(true); | 336 view4->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); |
337 pane2->AddChildView(view4); | 337 pane2->AddChildView(view4); |
338 | 338 |
339 std::vector<views::View*> panes; | 339 std::vector<views::View*> panes; |
340 panes.push_back(pane1); | 340 panes.push_back(pane1); |
341 panes.push_back(pane2); | 341 panes.push_back(pane2); |
342 | 342 |
343 test_widget_delegate->SetAccessiblePanes(panes); | 343 test_widget_delegate->SetAccessiblePanes(panes); |
344 | 344 |
345 views::FocusManager* focus_manager = browser_widget->GetFocusManager(); | 345 views::FocusManager* focus_manager = browser_widget->GetFocusManager(); |
346 | 346 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // Cycle focus to the shelf. | 423 // Cycle focus to the shelf. |
424 Shell::GetInstance()->focus_cycler()->RotateFocus(FocusCycler::FORWARD); | 424 Shell::GetInstance()->focus_cycler()->RotateFocus(FocusCycler::FORWARD); |
425 | 425 |
426 // Cycle focus should go back to the browser. | 426 // Cycle focus should go back to the browser. |
427 Shell::GetInstance()->focus_cycler()->RotateFocus(FocusCycler::FORWARD); | 427 Shell::GetInstance()->focus_cycler()->RotateFocus(FocusCycler::FORWARD); |
428 EXPECT_TRUE(wm::IsActiveWindow(window.get())); | 428 EXPECT_TRUE(wm::IsActiveWindow(window.get())); |
429 } | 429 } |
430 | 430 |
431 } // namespace test | 431 } // namespace test |
432 } // namespace ash | 432 } // namespace ash |
OLD | NEW |