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

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

Issue 2451323002: Remove RestoreFocusedView in OnWindowActivated for DesktopNativeWidgetAura (Closed)
Patch Set: Created 4 years, 2 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f6d0a352776b4b211f012efb1be3ac35024d86db..2b97e97404b9c9b1e79ceb42c319a312f611d0d2 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -244,7 +244,6 @@ DesktopNativeWidgetAura::DesktopNativeWidgetAura(
content_window_(new aura::Window(this)),
native_widget_delegate_(delegate),
last_drop_operation_(ui::DragDropTypes::DRAG_NONE),
- restore_focus_on_activate_(false),
cursor_(gfx::kNullCursor),
widget_type_(Widget::InitParams::TYPE_WINDOW),
close_widget_factory_(this) {
@@ -1080,16 +1079,11 @@ void DesktopNativeWidgetAura::OnWindowActivated(
aura::client::ActivationChangeObserver::ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) {
- DCHECK(content_window_ == gained_active || content_window_ == lost_active);
sky 2016/10/26 23:47:59 This DCHECK still seems useful. Is there a reason
Qiang(Joe) Xu 2016/10/27 17:28:17 Agree. I restored it.
- if (gained_active == content_window_ && restore_focus_on_activate_) {
- restore_focus_on_activate_ = false;
- GetWidget()->GetFocusManager()->RestoreFocusedView();
sky 2016/10/26 23:47:59 I'm not understanding why you only want to do the
Qiang(Joe) Xu 2016/10/27 17:28:17 Restore on activation should depend on desktop nat
- } else if (lost_active == content_window_ && GetWidget()->HasFocusManager()) {
- DCHECK(!restore_focus_on_activate_);
- restore_focus_on_activate_ = true;
- // Pass in false so that ClearNativeFocus() isn't invoked.
- GetWidget()->GetFocusManager()->StoreFocusedView(false);
- }
+ if (content_window_ != lost_active || !GetWidget()->HasFocusManager())
+ return;
+
+ // Pass in false so that ClearNativeFocus() isn't invoked.
+ GetWidget()->GetFocusManager()->StoreFocusedView(false);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698