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

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

Issue 12086095: Fixed drag and drop into and out of Browser Plugin. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Splitting up patch Created 7 years, 8 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 | « content/browser/web_contents/web_drag_source_win.h ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_drag_source_win.cc
diff --git a/content/browser/web_contents/web_drag_source_win.cc b/content/browser/web_contents/web_drag_source_win.cc
index 03cdbf250348c4c4ef7109ab8d0fd74aad79cc71..53df4e81725e0984a3f09e7ec496eb022174095f 100644
--- a/content/browser/web_contents/web_drag_source_win.cc
+++ b/content/browser/web_contents/web_drag_source_win.cc
@@ -6,11 +6,11 @@
#include "base/bind.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/browser/web_contents/web_contents_impl.h"
#include "content/browser/web_contents/web_drag_utils_win.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
-#include "content/public/browser/web_contents.h"
#include "ui/base/dragdrop/os_exchange_data.h"
using WebKit::WebDragOperationNone;
@@ -36,7 +36,7 @@ WebDragSource::WebDragSource(gfx::NativeWindow source_wnd,
WebContents* web_contents)
: ui::DragSourceWin(),
source_wnd_(source_wnd),
- render_view_host_(web_contents->GetRenderViewHost()),
+ web_contents_(static_cast<WebContentsImpl*>(web_contents)),
effect_(DROPEFFECT_NONE),
data_(NULL) {
registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_SWAPPED,
@@ -57,15 +57,15 @@ void WebDragSource::OnDragSourceCancel() {
return;
}
- if (!render_view_host_)
+ if (!web_contents_)
return;
gfx::Point client;
gfx::Point screen;
GetCursorPositions(source_wnd_, &client, &screen);
- render_view_host_->DragSourceEndedAt(client.x(), client.y(),
- screen.x(), screen.y(),
- WebDragOperationNone);
+ web_contents_->DragSourceEndedAt(client.x(), client.y(),
+ screen.x(), screen.y(),
+ WebDragOperationNone);
}
void WebDragSource::OnDragSourceDrop() {
@@ -82,15 +82,14 @@ void WebDragSource::OnDragSourceDrop() {
}
void WebDragSource::DelayedOnDragSourceDrop() {
- if (!render_view_host_)
+ if (!web_contents_)
return;
gfx::Point client;
gfx::Point screen;
GetCursorPositions(source_wnd_, &client, &screen);
- render_view_host_->DragSourceEndedAt(
- client.x(), client.y(), screen.x(), screen.y(),
- WinDragOpToWebDragOp(effect_));
+ web_contents_->DragSourceEndedAt(client.x(), client.y(), screen.x(),
+ screen.y(), WinDragOpToWebDragOp(effect_));
}
void WebDragSource::OnDragSourceMove() {
@@ -102,14 +101,14 @@ void WebDragSource::OnDragSourceMove() {
return;
}
- if (!render_view_host_)
+ if (!web_contents_)
return;
gfx::Point client;
gfx::Point screen;
GetCursorPositions(source_wnd_, &client, &screen);
- render_view_host_->DragSourceMovedTo(client.x(), client.y(),
- screen.x(), screen.y());
+ web_contents_->DragSourceMovedTo(client.x(), client.y(),
+ screen.x(), screen.y());
}
void WebDragSource::Observe(int type,
@@ -119,12 +118,12 @@ void WebDragSource::Observe(int type,
// When the WebContents get swapped, our render view host goes away.
// That's OK, we can continue the drag, we just can't send messages back to
// our drag source.
- render_view_host_ = NULL;
+ web_contents_ = NULL;
} else if (type == NOTIFICATION_WEB_CONTENTS_DISCONNECTED) {
// This could be possible when we close the tab and the source is still
// being used in DoDragDrop at the time that the virtual file is being
// downloaded.
- render_view_host_ = NULL;
+ web_contents_ = NULL;
}
}
« no previous file with comments | « content/browser/web_contents/web_drag_source_win.h ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698