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

Unified Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 23874013: Remove old activation code and disable-focus-controller flags (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/widget/desktop_aura/desktop_native_widget_aura.cc
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index 6a63e63a276066dd475ae62eeeaaddd65c9ff59a..4febefdbcc384f263f77382938af394fb5a4cf94 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -866,28 +866,10 @@ void DesktopNativeWidgetAura::OnWindowActivated(aura::Window* gained_active,
restore_focus_on_activate_ = false;
GetWidget()->GetFocusManager()->RestoreFocusedView();
} else if (lost_active == window_ && GetWidget()->HasFocusManager()) {
- bool store_focused_view = corewm::UseFocusControllerOnDesktop();
- if (!store_focused_view) {
- // If we're losing focus to a window that is a top level (such as a
- // bubble) store the focus. Such a window shares the same
- // RootWindowHost, so that such a change won't trigger an activation
- // change (which calls StoreFocusedView()). Without this the focused
- // view is never told it lost focus.
- aura::Window* focused_window =
- aura::client::GetFocusClient(window_)->GetFocusedWindow();
- if (focused_window && focused_window != window_) {
- Widget* focused_widget =
- Widget::GetWidgetForNativeWindow(focused_window);
- store_focused_view = focused_widget && focused_widget != GetWidget() &&
- focused_widget->is_top_level();
- }
- }
- if (store_focused_view) {
- DCHECK(!restore_focus_on_activate_);
- restore_focus_on_activate_ = true;
- // Pass in false so that ClearNativeFocus() isn't invoked.
- GetWidget()->GetFocusManager()->StoreFocusedView(false);
- }
+ DCHECK(!restore_focus_on_activate_);
+ restore_focus_on_activate_ = true;
+ // Pass in false so that ClearNativeFocus() isn't invoked.
+ GetWidget()->GetFocusManager()->StoreFocusedView(false);
}
}

Powered by Google App Engine
This is Rietveld 408576698