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

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

Issue 574583002: Do not release capture when clicking to open select box (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: 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 a54d860bc9e646cb9c5d0c9b52559e8042e2f17f..e2f3b6ebc1cc233445a0e633ad4403883f43ca2a 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -516,10 +516,8 @@ void RenderWidgetHostViewAura::InitAsPopup(
SetBounds(bounds_in_screen);
Show();
-#if !defined(OS_WIN) && !defined(OS_CHROMEOS)
- if (NeedsInputGrab())
+ if (NeedsMouseCapture())
window_->SetCapture();
-#endif
event_filter_for_popup_exit_.reset(new EventFilterForPopupExit(this));
}
@@ -1869,7 +1867,8 @@ void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
FinishImeCompositionSession();
break;
case ui::ET_MOUSE_RELEASED:
- window_->ReleaseCapture();
+ if (!NeedsMouseCapture())
+ window_->ReleaseCapture();
oshima 2014/09/16 16:17:24 who is closing the popup in this case?
pkotwicz 2014/09/17 02:27:58 The popup is closed when - The user clicks somewhe
break;
default:
break;
@@ -2204,6 +2203,13 @@ bool RenderWidgetHostViewAura::NeedsInputGrab() {
return popup_type_ == blink::WebPopupTypeSelect;
}
+bool RenderWidgetHostViewAura::NeedsMouseCapture() {
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+ return NeedsInputGrab();
+#endif
+ return false;
+}
+
void RenderWidgetHostViewAura::FinishImeCompositionSession() {
if (!has_composition_text_)
return;

Powered by Google App Engine
This is Rietveld 408576698