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 8d3df3bd923206398feeb86662585936116c3336..dad412a0444d651d3e3c4ad8a116d5508f6584ad 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc |
@@ -345,12 +345,9 @@ void RenderWidgetHostViewAura::ApplyEventFilterForPopupExit( |
// If we enter this code path it means that we did not receive any focus |
// lost notifications for the popup window. Ensure that blink is aware |
// of the fact that focus was lost for the host window by sending a Blur |
- // notification. We also set a flag in the view indicating that we need |
- // to force a Focus notification on the next mouse down. |
- if (popup_parent_host_view_ && popup_parent_host_view_->host_) { |
- popup_parent_host_view_->set_focus_on_mouse_down_ = true; |
+ // notification. |
+ if (popup_parent_host_view_ && popup_parent_host_view_->host_) |
popup_parent_host_view_->host_->Blur(); |
- } |
// Note: popup_parent_host_view_ may be NULL when there are multiple |
// popup children per view. See: RenderWidgetHostViewAura::InitAsPopup(). |
Shutdown(); |
@@ -472,7 +469,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host, |
has_snapped_to_boundary_(false), |
is_guest_view_hack_(is_guest_view_hack), |
begin_frame_observer_proxy_(this), |
- set_focus_on_mouse_down_(false), |
weak_ptr_factory_(this) { |
if (!is_guest_view_hack_) |
host_->SetView(this); |
@@ -748,10 +744,6 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() { |
::SetFocus(host->GetAcceleratedWidget()); |
} |
#endif |
- if (host_ && set_focus_on_mouse_down_) { |
- set_focus_on_mouse_down_ = false; |
- host_->Focus(); |
- } |
} |
RenderFrameHostImpl* RenderWidgetHostViewAura::GetFocusedFrame() { |
@@ -1522,11 +1514,13 @@ void RenderWidgetHostViewAura::UnlockMouse() { |
mouse_locked_ = false; |
-#if !defined(OS_WIN) |
- window_->ReleaseCapture(); |
-#else |
+ if (window_->HasCapture()) |
+ window_->ReleaseCapture(); |
+ |
+#if defined(OS_WIN) |
::ClipCursor(NULL); |
#endif |
+ |
window_->MoveCursorTo(unlocked_mouse_position_); |
aura::client::CursorClient* cursor_client = |
aura::client::GetCursorClient(root_window); |