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

Unified Diff: content/browser/web_contents/web_contents_view_gtk.cc

Issue 14918012: Fix check for updating WebDragDestGtk when creating a view for a RVH. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove DCHECK since it can be legitimately hit if a renderer crashes. Created 7 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f263c5f3f10073b3d3169dd78cfe707d4badd22a 100644
--- a/content/browser/web_contents/web_contents_view_gtk.cc
+++ b/content/browser/web_contents/web_contents_view_gtk.cc
@@ -223,12 +223,17 @@ 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 navigations that create non-swapped-out views that may
+ // never be displayed, e.g. a navigation that becomes a download.
+ if (rvh == web_contents_->GetRenderViewHost()) {
UpdateDragDest(rvh);
+ }
}
return view;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698