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

Unified Diff: views/focus/focus_manager.cc

Issue 3013023: Fix regression that stopped properly restoring focus to tab contents.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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: views/focus/focus_manager.cc
===================================================================
--- views/focus/focus_manager.cc (revision 53196)
+++ views/focus/focus_manager.cc (working copy)
@@ -361,9 +361,22 @@
View* view = view_storage->RetrieveView(stored_focused_view_storage_id_);
if (view) {
- if (ContainsView(view) && (view->IsFocusableInRootView() ||
- view->IsAccessibilityFocusableInRootView())) {
- SetFocusedViewWithReason(view, kReasonFocusRestore);
+ if (ContainsView(view)) {
+ if (!view->IsFocusableInRootView() &&
+ view->IsAccessibilityFocusableInRootView()) {
+ // RequestFocus would fail, but we want to restore focus to controls
+ // that had focus in accessibility mode.
+ SetFocusedViewWithReason(view, kReasonFocusRestore);
+ } else {
+ // This usually just sets the focus if this view is focusable, but
+ // let the view override RequestFocus if necessary.
+ view->RequestFocus();
+
+ // If it succeeded, the reason would be incorrect; set it to
+ // focus restore.
+ if (focused_view_ == view)
+ focus_change_reason_ = kReasonFocusRestore;
+ }
}
} else {
// Clearing the focus will focus the root window, so we still get key
« 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