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..173a100bdfb5ff44f1364ca407ec47d1e7621463 100644 |
--- a/ui/views/focus/focus_manager.cc |
+++ b/ui/views/focus/focus_manager.cc |
@@ -313,6 +313,21 @@ 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 the widget isn't active store the focused view and then attempt to |
+ // activate the widget. If activation succeeds |view| will be focused. |
+ // If activation fails |view| will be focused the next time the widget is |
+ // made active. |
+ if (view && !widget_->IsActive()) { |
+ SetStoredFocusView(view); |
+ widget_->Activate(); |
+ 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. |