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

Side by Side Diff: ui/views/focus/focus_search.cc

Issue 886033002: Views: Fixed exponential behaviour on reverse focus search (Shift+Tab). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tab-class-name
Patch Set: Created 5 years, 10 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "ui/views/focus/focus_manager.h" 6 #include "ui/views/focus/focus_manager.h"
7 #include "ui/views/focus/focus_search.h" 7 #include "ui/views/focus/focus_search.h"
8 #include "ui/views/view.h" 8 #include "ui/views/view.h"
9 9
10 namespace views { 10 namespace views {
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // The selected view might not be focusable (if it is disabled for 244 // The selected view might not be focusable (if it is disabled for
245 // example). 245 // example).
246 if (IsFocusable(v)) 246 if (IsFocusable(v))
247 return v; 247 return v;
248 } 248 }
249 249
250 // Then try the left sibling. 250 // Then try the left sibling.
251 View* sibling = starting_view->GetPreviousFocusableView(); 251 View* sibling = starting_view->GetPreviousFocusableView();
252 if (sibling) { 252 if (sibling) {
253 return FindPreviousFocusableViewImpl(sibling, 253 return FindPreviousFocusableViewImpl(sibling,
254 true, true, true, 254 true, can_go_up, true,
255 skip_group_id, 255 skip_group_id,
256 focus_traversable, 256 focus_traversable,
257 focus_traversable_view); 257 focus_traversable_view);
258 } 258 }
259 259
260 // Then go up the parent. 260 // Then go up the parent.
261 if (can_go_up) { 261 if (can_go_up) {
262 View* parent = GetParent(starting_view); 262 View* parent = GetParent(starting_view);
263 if (parent) 263 if (parent)
264 return FindPreviousFocusableViewImpl(parent, 264 return FindPreviousFocusableViewImpl(parent,
265 true, true, false, 265 true, true, false,
266 skip_group_id, 266 skip_group_id,
267 focus_traversable, 267 focus_traversable,
268 focus_traversable_view); 268 focus_traversable_view);
269 } 269 }
270 270
271 // We found nothing. 271 // We found nothing.
272 return NULL; 272 return NULL;
273 } 273 }
274 274
275 } // namespace views 275 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/focus/focus_traversal_unittest.cc » ('j') | ui/views/focus/focus_traversal_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698