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

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

Issue 8892025: Reland r113741: Move {Restore,Store}FocusedView to NativeWidgetAura::On{Activated,LostActive} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | 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 4ad58269d2d0747ea1e151d012ee1caf2fb5338d..9113d79e99a2cc558316d98f9e9f9f8f27762adc 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -567,9 +567,6 @@ void NativeWidgetAura::OnFocus() {
if (widget->is_top_level()) {
InputMethod* input_method = widget->GetInputMethod();
input_method->OnFocus();
- // See description of got_initial_focus_in_ for details on this.
- // TODO(mazda): Investigate this is actually necessary.
- // widget->GetFocusManager()->RestoreFocusedView();
}
delegate_->OnNativeFocus(window_);
}
@@ -579,7 +576,6 @@ void NativeWidgetAura::OnBlur() {
if (widget->is_top_level()) {
InputMethod* input_method = widget->GetInputMethod();
input_method->OnBlur();
- widget->GetFocusManager()->StoreFocusedView();
}
delegate_->OnNativeBlur(NULL);
}
@@ -634,12 +630,14 @@ bool NativeWidgetAura::ShouldActivate(aura::Event* event) {
}
void NativeWidgetAura::OnActivated() {
+ GetWidget()->GetFocusManager()->RestoreFocusedView();
delegate_->OnNativeWidgetActivationChanged(true);
if (IsVisible() && GetWidget()->non_client_view())
GetWidget()->non_client_view()->SchedulePaint();
}
void NativeWidgetAura::OnLostActive() {
+ GetWidget()->GetFocusManager()->StoreFocusedView();
delegate_->OnNativeWidgetActivationChanged(false);
if (IsVisible() && GetWidget()->non_client_view())
GetWidget()->non_client_view()->SchedulePaint();
« no previous file with comments | « no previous file | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698