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

Unified Diff: ui/views/widget/widget.cc

Issue 2604303002: (Mac)Views: Widgets focus first View in traversal order if initial focus fails. (Closed)
Patch Set: Revert most changes and move fix to Widget::SetInitialFocus() instead. Created 3 years, 12 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: ui/views/widget/widget.cc
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index 08578add8f534fe637481183fd005dbc34a58a1c..8bba4c5f390d6217fc9ec9c0e0aee45e0f112bfe 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -1312,8 +1312,13 @@ bool Widget::SetInitialFocus(ui::WindowShowState show_state) {
focus_manager_->SetStoredFocusView(v);
return true;
}
- if (v)
+ if (v) {
v->RequestFocus();
tapted 2017/01/04 03:59:38 This is a bit inconsistent. View::RequestFocus() u
Patti Lor 2017/01/06 06:15:09 Done.
+ // If the request for focus was unsuccessful, fall back to using the first
+ // focusable View instead.
+ if (focus_manager_ && v != focus_manager_->GetFocusedView())
tapted 2017/01/04 03:59:38 Is it enough just to call focus_manager->AdvanceFo
Patti Lor 2017/01/06 06:15:09 No - AdvanceFocusIfNecessary is only meant to make
+ focus_manager_->AdvanceFocus(false);
+ }
return !!v;
}
« 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