Chromium Code Reviews| Index: ui/views/focus/focus_manager.cc |
| diff --git a/ui/views/focus/focus_manager.cc b/ui/views/focus/focus_manager.cc |
| index 436daf0c04f11bf7ec761fead33d15356acec9ff..bd6b0dc19fe4749a958afe41f8c49dd158ed446a 100644 |
| --- a/ui/views/focus/focus_manager.cc |
| +++ b/ui/views/focus/focus_manager.cc |
| @@ -387,16 +387,23 @@ void FocusManager::StoreFocusedView(bool clear_native_focus) { |
| bool FocusManager::RestoreFocusedView() { |
| View* view = GetStoredFocusView(); |
| - if (view && ContainsView(view)) { |
| - // This usually just sets the focus if this view is accessibility |
| - // 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; |
| - |
| + if (view) { |
|
karandeepb
2016/05/13 09:05:31
This is the same as the code before https://codere
|
| + if (ContainsView(view)) { |
| + if (!view->IsFocusable() && view->IsAccessibilityFocusable()) { |
| + // 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; |
| + } |
| + } |
| // The |keyboard_accessible_| mode may have changed while the widget was |
| // inactive. |
| AdvanceFocusIfNecessary(); |