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

Unified Diff: content/browser/tab_contents/web_drag_source_gtk.cc

Issue 9473001: Extract minimal RenderViewHost interface for embedders, leaving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR. Created 8 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
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();
}
« no previous file with comments | « content/browser/tab_contents/web_drag_source_gtk.h ('k') | content/browser/tab_contents/web_drag_source_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698