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

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

Issue 12252016: Prevented connecting drag drop events to a SwappedOut RenderViewHost in WebContentsViewGtk (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 10 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 8f64ef04175b463e027559e10f41676c08bc9757..9c091b875d5aed5e91b68f437d79bdb806ed8214 100644
--- a/content/browser/web_contents/web_contents_view_gtk.cc
+++ b/content/browser/web_contents/web_contents_view_gtk.cc
@@ -128,6 +128,15 @@ RenderWidgetHostView* WebContentsViewGtk::CreateViewForWidget(
RenderWidgetHostView* view =
RenderWidgetHostView::CreateViewForWidget(render_widget_host);
view->InitAsChild(NULL);
+ if (render_widget_host->IsRenderView()) {
+ RenderViewHost* rvh = RenderViewHost::From(render_widget_host);
+ // A swapped out RenderViewHost is not visible, and so there is no reason
+ // to connect events to it, or use it as a WebDragDest (It won't be able
+ // to receive drag updates, and may break drag and drop in a window).
+ if (web_contents_->GetRenderManagerForTesting()->IsSwappedOut(rvh)) {
Fady Samuel 2013/02/13 21:15:22 This looks wrong...GetRenderManagerForTesting is s
Charlie Reis 2013/02/20 06:42:45 Fady's right-- this would be a layering violation.
+ return view;
+ }
+ }
gfx::NativeView content_view = view->GetNativeView();
g_signal_connect(content_view, "focus", G_CALLBACK(OnFocusThunk), this);
g_signal_connect(content_view, "leave-notify-event",
« 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