Chromium Code Reviews| Index: content/browser/web_contents/web_contents_view_gtk.cc |
| diff --git a/content/browser/web_contents/web_contents_view_gtk.cc b/content/browser/web_contents/web_contents_view_gtk.cc |
| index 9cb9212787816e8c54b169cb2bc5f3a37229a326..ccbe0bdbf9f4152f663d2945616b90a1c283bb1f 100644 |
| --- a/content/browser/web_contents/web_contents_view_gtk.cc |
| +++ b/content/browser/web_contents/web_contents_view_gtk.cc |
| @@ -223,12 +223,18 @@ RenderWidgetHostView* WebContentsViewGtk::CreateViewForWidget( |
| GDK_POINTER_MOTION_MASK); |
| InsertIntoContentArea(content_view); |
| - // We don't want to change any state in this class for swapped out RVHs |
| - // because they will not be visible at this time. |
| if (render_widget_host->IsRenderView()) { |
| RenderViewHost* rvh = RenderViewHost::From(render_widget_host); |
| - if (!static_cast<RenderViewHostImpl*>(rvh)->is_swapped_out()) |
| + // If |rvh| is already the current render view host for the web contents, we |
| + // need to initialize |drag_dest_| for drags to be properly handled. |
| + // Otherwise, |drag_dest_| will be updated in RenderViewSwappedIn. The |
| + // reason we can't simply check that this isn't a swapped out view is |
| + // because there are other navigations that create views that may never be |
|
Charlie Reis
2013/05/18 01:37:59
nit: that create non-swapped-out views that may ne
dcheng
2013/05/18 01:49:52
Done.
|
| + // displayed, e.g. a navigation that turns into a download. |
| + if (rvh == web_contents_->GetRenderViewHost()) { |
| + DCHECK(!drag_dest_); |
| UpdateDragDest(rvh); |
| + } |
| } |
| return view; |