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

Unified Diff: ui/views/focus/focus_manager.cc

Issue 2371113003: Do not give instant focus if a view's toplevelwidget is not active (Closed)
Patch Set: new patch Created 4 years, 3 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
Index: ui/views/focus/focus_manager.cc
diff --git a/ui/views/focus/focus_manager.cc b/ui/views/focus/focus_manager.cc
index 80a4dc8d6bdd0c7b67ee984e6081e434cebe6db1..82466781f62c877554a9e2d804594fb7f7387c59 100644
--- a/ui/views/focus/focus_manager.cc
+++ b/ui/views/focus/focus_manager.cc
@@ -313,6 +313,18 @@ void FocusManager::SetFocusedViewWithReason(
if (focused_view_ == view)
return;
+#if !defined(OS_MACOSX)
+ // TODO(warx): There are some AccessiblePaneViewTest failed on macosx.
+ // crbug.com/650859. Remove !defined(OS_MACOSX) once that is fixed.
+ //
+ // If |widget_| is not active, focus is not allowed to set within |widget_|
+ // right now, we just need to store this view.
+ if (view && !widget_->IsActive()) {
+ SetStoredFocusView(view);
+ return;
+ }
+#endif
+
base::AutoReset<bool> auto_changing_focus(&is_changing_focus_, true);
// Update the reason for the focus change (since this is checked by
// some listeners), then notify all listeners.

Powered by Google App Engine
This is Rietveld 408576698