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

Unified Diff: ui/views/focus/focus_search.cc

Issue 10982007: Merge 157914 - Fix toolbar keyboard accessibility on Views (alternative impl). (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/src/
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/focus/focus_search.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/focus/focus_search.cc
===================================================================
--- ui/views/focus/focus_search.cc (revision 158380)
+++ ui/views/focus/focus_search.cc (working copy)
@@ -44,7 +44,7 @@
check_starting_view = true;
} else {
// The starting view should be a direct or indirect child of the root.
- DCHECK(root_->Contains(starting_view));
+ DCHECK(Contains(root_, starting_view));
}
View* v = NULL;
@@ -68,7 +68,7 @@
}
// Don't set the focus to something outside of this view hierarchy.
- if (v && v != root_ && !root_->Contains(v))
+ if (v && v != root_ && !Contains(root_, v))
v = NULL;
// If |cycle_| is true, prefer to keep cycling rather than returning NULL.
@@ -118,9 +118,13 @@
}
View* FocusSearch::GetParent(View* v) {
- return root_->Contains(v) ? v->parent() : NULL;
+ return Contains(root_, v) ? v->parent() : NULL;
}
+bool FocusSearch::Contains(View* root, const View* v) {
+ return root->Contains(v);
+}
+
// Strategy for finding the next focusable view:
// - keep going down the first child, stop when you find a focusable view or
// a focus traversable view (in that case return it) or when you reach a view
@@ -179,7 +183,7 @@
// Then go up to the parent sibling.
if (can_go_up) {
View* parent = GetParent(starting_view);
- while (parent) {
+ while (parent && parent != root_) {
sibling = parent->GetNextFocusableView();
if (sibling) {
return FindNextFocusableViewImpl(sibling,
« no previous file with comments | « ui/views/focus/focus_search.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698