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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 285403003: Re-land: Store and restore view focus in OnWindowFocused. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable ConstrainedWindowViewTest.ClosesOnEscape on Win XP. Created 6 years, 7 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 | « ui/views/widget/desktop_aura/desktop_native_widget_aura.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 2e564fa5a8adff1bee71a001e83c5405ad073619..c1064fc443f1117e98fe62015be64c817071ff7f 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -899,6 +899,7 @@ void NativeWidgetAura::OnWindowFocused(aura::Window* gained_focus,
if (GetWidget()->GetInputMethod()) // Null in tests.
GetWidget()->GetInputMethod()->OnFocus();
delegate_->OnNativeFocus(lost_focus);
+ GetWidget()->GetFocusManager()->RestoreFocusedView();
} else if (window_ == lost_focus) {
// GetInputMethod() recreates the input method if it's previously been
// destroyed. If we get called during destruction, the input method will be
@@ -914,9 +915,8 @@ void NativeWidgetAura::OnWindowFocused(aura::Window* gained_focus,
DCHECK_EQ(ownership_, Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET);
}
- aura::client::FocusClient* client = aura::client::GetFocusClient(window_);
- if (client) // NULL during destruction of aura::Window.
- delegate_->OnNativeBlur(client->GetFocusedWindow());
+ delegate_->OnNativeBlur(gained_focus);
+ GetWidget()->GetFocusManager()->StoreFocusedView(true);
}
}
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698