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

Unified Diff: chrome/views/focus_manager.cc

Issue 20347: Fix some focus traversal issues:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/focus_manager.cc
===================================================================
--- chrome/views/focus_manager.cc (revision 9712)
+++ chrome/views/focus_manager.cc (working copy)
@@ -469,7 +469,12 @@
void FocusManager::AdvanceFocus(bool reverse) {
View* v = GetNextFocusableView(focused_view_, reverse, false);
- if (v && (v != focused_view_)) {
+ // Note: Do not skip this next block when v == focused_view_. If the user
+ // tabs past the last focusable element in a webpage, we'll get here, and if
+ // the TabContentsContainerView is the only focusable view (possible in
+ // fullscreen mode), we need to run this block in order to cycle around to the
+ // first element on the page.
+ if (v) {
v->AboutToRequestFocusFromTabTraversal(reverse);
v->RequestFocus();
}
@@ -553,18 +558,11 @@
}
View* FocusManager::FindLastFocusableView() {
- // For now we'll just walk the entire focus loop until we reach the end.
-
- // Let's start at whatever focused view we are at.
- View* starting_view = focused_view_;
-
- // Now advance until you reach the end.
+ // Just walk the entire focus loop from where we're at until we reach the end.
View* new_focused = NULL;
- View* last_focused = NULL;
- while (new_focused = GetNextFocusableView(starting_view, false, true)) {
+ View* last_focused = focused_view_;
+ while (new_focused = GetNextFocusableView(last_focused, false, true))
last_focused = new_focused;
- starting_view = new_focused;
- }
return last_focused;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698