Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_input_event_router.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_input_event_router.cc b/content/browser/renderer_host/render_widget_host_input_event_router.cc |
| index b0b580f1a0c9a1434153c6bf847f60f7f8ceefe0..6c95a3a2e6f3bcfacb673e118140584e941011f2 100644 |
| --- a/content/browser/renderer_host/render_widget_host_input_event_router.cc |
| +++ b/content/browser/renderer_host/render_widget_host_input_event_router.cc |
| @@ -90,7 +90,7 @@ void RenderWidgetHostInputEventRouter::OnRenderWidgetHostViewBaseDestroyed( |
| else |
| last_mouse_move_target_ = nullptr; |
| - if (!last_mouse_move_target_) |
| + if (!last_mouse_move_target_ || view == last_mouse_move_root_view_) |
| last_mouse_move_root_view_ = nullptr; |
| } |
| } |
| @@ -383,13 +383,18 @@ void RenderWidgetHostInputEventRouter::SendMouseEnterOrLeaveEvents( |
| RenderWidgetHostViewBase* cur_view = target; |
| entered_views.push_back(cur_view); |
| while (cur_view != root_view) { |
| - // Non-root RWHVs are guaranteed to be RenderWidgetHostViewChildFrames. |
| + // Non-root RWHVs are guaranteed to be RenderWidgetHostViewChildFrames, |
| + // as long as they are the only embeddable RWHVs. |
| + CHECK(cur_view->IsRenderWidgetHostViewChildFrame()); |
|
ncarter (slow)
2016/10/07 17:52:27
If we can't guarantee this via static typing, then
kenrb
2016/10/07 18:44:24
I'm not clear on how that would work. RWHVCF::GetP
|
| cur_view = |
| static_cast<RenderWidgetHostViewChildFrame*>(cur_view)->GetParentView(); |
| // cur_view can possibly be nullptr for guestviews that are not currently |
| // connected to the webcontents tree. |
| - if (!cur_view) |
| - break; |
| + if (!cur_view) { |
| + last_mouse_move_target_ = target; |
| + last_mouse_move_root_view_ = root_view; |
| + return; |
| + } |
| entered_views.push_back(cur_view); |
| } |
| @@ -397,10 +402,14 @@ void RenderWidgetHostInputEventRouter::SendMouseEnterOrLeaveEvents( |
| if (cur_view) { |
| exited_views.push_back(cur_view); |
| while (cur_view != root_view) { |
| + CHECK(cur_view->IsRenderWidgetHostViewChildFrame()); |
| cur_view = static_cast<RenderWidgetHostViewChildFrame*>(cur_view) |
| ->GetParentView(); |
| - if (!cur_view) |
| - break; |
| + if (!cur_view) { |
| + last_mouse_move_target_ = target; |
| + last_mouse_move_root_view_ = root_view; |
| + return; |
| + } |
| exited_views.push_back(cur_view); |
| } |
| } |