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

Unified Diff: ui/views/corewm/focus_controller.cc

Issue 14298013: Check focusability in WindowFocusedFromInputEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update FocusController tests Created 7 years, 8 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 | « ash/wm/window_manager_unittest.cc ('k') | ui/views/corewm/focus_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/focus_controller.cc
diff --git a/ui/views/corewm/focus_controller.cc b/ui/views/corewm/focus_controller.cc
index 1daba43ccef717480513e41273af4d8f42515a7f..eaab15101820708b88242137c2ffe4cd836e7915 100644
--- a/ui/views/corewm/focus_controller.cc
+++ b/ui/views/corewm/focus_controller.cc
@@ -336,7 +336,11 @@ void FocusController::WindowLostFocusFromDispositionChange(
}
void FocusController::WindowFocusedFromInputEvent(aura::Window* window) {
- FocusWindow(window);
+ // Only focus |window| if it or any of its parents can be focused. Otherwise
+ // FocusWindow() will focus the topmost window, which may not be the
+ // currently focused one.
+ if (rules_->CanFocusWindow(GetToplevelWindow(window)))
+ FocusWindow(window);
}
} // namespace corewm
« no previous file with comments | « ash/wm/window_manager_unittest.cc ('k') | ui/views/corewm/focus_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698