Chromium Code Reviews| Index: content/browser/frame_host/render_widget_host_view_child_frame.cc |
| diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc |
| index e3a036176bbdbf690e3546a543b0b2c005d3fd63..a461feb1980872eb4d81b74a179d9b82d4c1deb4 100644 |
| --- a/content/browser/frame_host/render_widget_host_view_child_frame.cc |
| +++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc |
| @@ -77,6 +77,12 @@ void RenderWidgetHostViewChildFrame::SetCrossProcessFrameConnector( |
| id_allocator_->id_namespace()); |
| parent_surface_id_namespace_ = 0; |
| + |
| + // After the RenderWidgetHostViewChildFrame loses the frame_connector, it |
| + // won't be able to walk up the frame tree anymore. Cleanup anything that |
| + // needs to be done through the CrossProcessFrameConnector. |
|
Charlie Reis
2016/07/07 21:47:13
nit: s/Cleanup/Clean up/
nit: Add "before it's gon
lfg
2016/07/11 19:11:29
Done.
|
| + // Unlocks the mouse if this RenderWidgetHostView holds the lock. |
| + UnlockMouse(); |
| } |
| frame_connector_ = frame_connector; |
| if (frame_connector_) { |
| @@ -469,19 +475,16 @@ bool RenderWidgetHostViewChildFrame::LockMouse() { |
| } |
| void RenderWidgetHostViewChildFrame::UnlockMouse() { |
| + if (host_->delegate() && host_->delegate()->HasMouseLock(host_) && |
| + frame_connector_) |
| + frame_connector_->UnlockMouse(); |
| } |
| bool RenderWidgetHostViewChildFrame::IsMouseLocked() { |
| - if (!frame_connector_) |
| + if (!host_->delegate()) |
| return false; |
| - RenderWidgetHostViewBase* root_view = |
| - frame_connector_->GetRootRenderWidgetHostView(); |
| - |
| - if (root_view) |
| - return root_view->IsMouseLocked(); |
| - |
| - return false; |
| + return host_->delegate()->HasMouseLock(host_); |
| } |
| uint32_t RenderWidgetHostViewChildFrame::GetSurfaceIdNamespace() { |