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

Side by Side Diff: ash/focus_cycler_unittest.cc

Issue 1898633004: Views: Add new SetFocusBehavior method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 7 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 | « no previous file | ash/shelf/overflow_button.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 (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
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/shelf/overflow_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698