Index: content/browser/tab_contents/web_drag_source_gtk.cc |
diff --git a/content/browser/tab_contents/web_drag_source_gtk.cc b/content/browser/tab_contents/web_drag_source_gtk.cc |
index 6be0dc64c93031bcfd59a07058b2d866ea720cb4..2ac997f1b822a92c8feed2ee7766bc9c09b1cc75 100644 |
--- a/content/browser/tab_contents/web_drag_source_gtk.cc |
+++ b/content/browser/tab_contents/web_drag_source_gtk.cc |
@@ -165,8 +165,8 @@ void WebDragSourceGtk::DidProcessEvent(GdkEvent* event) { |
GdkEventMotion* event_motion = reinterpret_cast<GdkEventMotion*>(event); |
gfx::Point client = ui::ClientPoint(GetContentNativeView()); |
- if (web_contents_->GetRenderViewHost()) { |
- web_contents_->GetRenderViewHost()->DragSourceMovedTo( |
+ if (GetRenderViewHost()) { |
+ GetRenderViewHost()->DragSourceMovedTo( |
client.x(), client.y(), |
static_cast<int>(event_motion->x_root), |
static_cast<int>(event_motion->y_root)); |
@@ -300,8 +300,8 @@ gboolean WebDragSourceGtk::OnDragFailed(GtkWidget* sender, |
gfx::Point root = ui::ScreenPoint(GetContentNativeView()); |
gfx::Point client = ui::ClientPoint(GetContentNativeView()); |
- if (web_contents_->GetRenderViewHost()) { |
- web_contents_->GetRenderViewHost()->DragSourceEndedAt( |
+ if (GetRenderViewHost()) { |
+ GetRenderViewHost()->DragSourceEndedAt( |
client.x(), client.y(), root.x(), root.y(), |
WebDragOperationNone); |
} |
@@ -372,8 +372,8 @@ void WebDragSourceGtk::OnDragEnd(GtkWidget* sender, |
gfx::Point root = ui::ScreenPoint(GetContentNativeView()); |
gfx::Point client = ui::ClientPoint(GetContentNativeView()); |
- if (web_contents_->GetRenderViewHost()) { |
- web_contents_->GetRenderViewHost()->DragSourceEndedAt( |
+ if (GetRenderViewHost()) { |
+ GetRenderViewHost()->DragSourceEndedAt( |
client.x(), client.y(), root.x(), root.y(), |
content::GdkDragActionToWebDragOp(drag_context->action)); |
} |
@@ -385,6 +385,10 @@ void WebDragSourceGtk::OnDragEnd(GtkWidget* sender, |
drag_context_ = NULL; |
} |
+RenderViewHostImpl* WebDragSourceGtk::GetRenderViewHost() const { |
+ return static_cast<RenderViewHostImpl*>(web_contents_->GetRenderViewHost()); |
+} |
+ |
gfx::NativeView WebDragSourceGtk::GetContentNativeView() const { |
return web_contents_->GetView()->GetContentNativeView(); |
} |