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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 652793003: Close the select box when the parent RWHVA loses focus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index a7eb8d667baec6cc472c40178036fbbd5c092b27..7e2521e27f060126831396b5b64663c6b7d65fbf 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -387,8 +387,7 @@ void RenderWidgetHostViewAura::ApplyEventFilterForPopupExit(
target != popup_parent_host_view_->window_)) {
// Note: popup_parent_host_view_ may be NULL when there are multiple
// popup children per view. See: RenderWidgetHostViewAura::InitAsPopup().
- in_shutdown_ = true;
- host_->Shutdown();
+ Shutdown();
}
}
@@ -1819,10 +1818,7 @@ void RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) {
}
}
}
- if (!in_shutdown_) {
- in_shutdown_ = true;
- host_->Shutdown();
- }
+ Shutdown();
} else {
if (event->key_code() == ui::VKEY_RETURN) {
// Do not forward return key release events if no press event was handled.
@@ -2212,9 +2208,15 @@ void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus,
return;
}
#endif
- in_shutdown_ = true;
- host_->Shutdown();
+ Shutdown();
+ return;
}
+
+ // Close the child popup window if we lose focus (e.g. due to a JS alert or
+ // system modal dialog). This is particularly important if
+ // |popup_child_host_view_| has mouse capture.
+ if (popup_child_host_view_)
+ popup_child_host_view_->Shutdown();
}
}
@@ -2305,6 +2307,13 @@ ui::InputMethod* RenderWidgetHostViewAura::GetInputMethod() const {
return root_window->GetProperty(aura::client::kRootWindowInputMethodKey);
}
+void RenderWidgetHostViewAura::Shutdown() {
+ if (!in_shutdown_) {
+ in_shutdown_ = true;
+ host_->Shutdown();
+ }
+}
+
bool RenderWidgetHostViewAura::NeedsInputGrab() {
return popup_type_ == blink::WebPopupTypeSelect;
}

Powered by Google App Engine
This is Rietveld 408576698