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

Unified Diff: views/focus/focus_manager.cc

Issue 125130: Fix focus traversal cycle. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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 | « views/focus/focus_manager.h ('k') | views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/focus/focus_manager.cc
===================================================================
--- views/focus/focus_manager.cc (revision 18389)
+++ views/focus/focus_manager.cc (working copy)
@@ -413,37 +413,19 @@
parent_focus_traversable->GetFocusTraversableParent();
}
- if (!dont_loop) {
- // If we get here, we have reached the end of the focus hierarchy, let's
- // loop.
- if (reverse) {
- // When reversing from the top, the next focusable view is at the end
- // of the focus hierarchy.
- return FindLastFocusableView();
- } else {
- // Easy, just clear the selection and press tab again.
- if (original_starting_view) { // Make sure there was at least a view to
- // start with, to prevent infinitely
- // looping in empty windows.
- // By calling with NULL as the starting view, we'll start from the
- // top_root_view.
- return GetNextFocusableView(NULL, false, true);
- }
- }
+ // If we get here, we have reached the end of the focus hierarchy, let's
+ // loop. Make sure there was at least a view to start with, to prevent
+ // infinitely looping in empty windows.
+ if (!dont_loop && original_starting_view) {
+ // Easy, just clear the selection and press tab again.
+ // By calling with NULL as the starting view, we'll start from the
+ // top_root_view.
+ return GetNextFocusableView(NULL, reverse, true);
}
}
return NULL;
}
-View* FocusManager::FindLastFocusableView() {
- // Just walk the entire focus loop from where we're at until we reach the end.
- View* new_focused = NULL;
- View* last_focused = focused_view_;
- while ((new_focused = GetNextFocusableView(last_focused, false, true)))
- last_focused = new_focused;
- return last_focused;
-}
-
void FocusManager::SetFocusedView(View* view) {
if (focused_view_ != view) {
View* prev_focused_view = focused_view_;
« no previous file with comments | « views/focus/focus_manager.h ('k') | views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698