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

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

Issue 82913009: Revert 236417 "Makes FocusdController honor focus change if no p..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 | trunk/src/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: trunk/src/ui/views/corewm/focus_controller.cc
===================================================================
--- trunk/src/ui/views/corewm/focus_controller.cc (revision 236878)
+++ trunk/src/ui/views/corewm/focus_controller.cc (working copy)
@@ -153,21 +153,13 @@
// Activation change observers may change the focused window. If this happens
// we must not adjust the focus below since this will clobber that change.
aura::Window* last_focused_window = focused_window_;
- aura::Window* last_active_window = active_window_;
if (!updating_activation_)
SetActiveWindow(window, activatable);
// If the window's ActivationChangeObserver shifted focus to a valid window,
// we don't want to focus the window we thought would be focused by default.
- //
- // Allow the request through if there was previously no active window. When
- // there is no active window and an attempt is made to activate a window views
- // may try to restore focus to the view (and thereby window) that previously
- // had focus. In this case we want to focus the window passed to this function
- // and not the previously focused window.
bool activation_changed_focus = last_focused_window != focused_window_;
- if (!updating_focus_ && (!activation_changed_focus || !focused_window_ ||
- !last_active_window)) {
+ if (!updating_focus_ && (!activation_changed_focus || !focused_window_)) {
if (active_window_ && focusable)
DCHECK(active_window_->Contains(focusable));
SetFocusedWindow(focusable);
« no previous file with comments | « no previous file | trunk/src/ui/views/corewm/focus_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698