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

Side by Side Diff: ui/views/view_targeter_unittest.cc

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/views/view_targeter.h" 5 #include "ui/views/view_targeter.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "ui/events/event_targeter.h" 9 #include "ui/events/event_targeter.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 widget.Init(init_params); 127 widget.Init(init_params);
128 128
129 View* content = new View; 129 View* content = new View;
130 View* child = new View; 130 View* child = new View;
131 View* grandchild = new View; 131 View* grandchild = new View;
132 132
133 widget.SetContentsView(content); 133 widget.SetContentsView(content);
134 content->AddChildView(child); 134 content->AddChildView(child);
135 child->AddChildView(grandchild); 135 child->AddChildView(grandchild);
136 136
137 grandchild->SetFocusable(true); 137 grandchild->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
138 grandchild->RequestFocus(); 138 grandchild->RequestFocus();
139 139
140 internal::RootView* root_view = 140 internal::RootView* root_view =
141 static_cast<internal::RootView*>(widget.GetRootView()); 141 static_cast<internal::RootView*>(widget.GetRootView());
142 ui::EventTargeter* targeter = root_view->targeter(); 142 ui::EventTargeter* targeter = root_view->targeter();
143 143
144 ui::KeyEvent key_event('a', ui::VKEY_A, ui::EF_NONE); 144 ui::KeyEvent key_event('a', ui::VKEY_A, ui::EF_NONE);
145 145
146 // The focused view should be the initial target of the event. 146 // The focused view should be the initial target of the event.
147 ui::EventTarget* current_target = targeter->FindTargetForEvent(root_view, 147 ui::EventTarget* current_target = targeter->FindTargetForEvent(root_view,
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 EXPECT_EQ(v1, root_view->GetTooltipHandlerForPoint(v1_origin)); 665 EXPECT_EQ(v1, root_view->GetTooltipHandlerForPoint(v1_origin));
666 EXPECT_EQ(root_view, root_view->GetTooltipHandlerForPoint(v2_origin)); 666 EXPECT_EQ(root_view, root_view->GetTooltipHandlerForPoint(v2_origin));
667 667
668 EXPECT_FALSE(v1->GetTooltipHandlerForPoint(v2_origin)); 668 EXPECT_FALSE(v1->GetTooltipHandlerForPoint(v2_origin));
669 669
670 widget->CloseNow(); 670 widget->CloseNow();
671 } 671 }
672 672
673 } // namespace test 673 } // namespace test
674 } // namespace views 674 } // namespace views
OLDNEW
« ui/views/view.cc ('K') | « ui/views/view.cc ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698