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 18c18819da7ffdd4d85c4a5e9f853005dda425f5..a202395c6f64ae437d0d65e04881cb61cf1c3cde 100644 |
--- a/content/browser/web_contents/web_drag_source_win.cc |
+++ b/content/browser/web_contents/web_drag_source_win.cc |
@@ -35,7 +35,7 @@ WebDragSource::WebDragSource(gfx::NativeWindow source_wnd, |
WebContents* web_contents) |
: ui::DragSourceWin(), |
source_wnd_(source_wnd), |
- render_view_host_(web_contents->GetRenderViewHost()), |
+ web_contents_(web_contents), |
effect_(DROPEFFECT_NONE) { |
registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_SWAPPED, |
Source<WebContents>(web_contents)); |
@@ -55,15 +55,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() { |
@@ -78,15 +78,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() { |
@@ -98,14 +97,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, |
@@ -115,12 +114,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; |
} |
} |