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

Side by Side Diff: content/browser/web_contents/web_contents_view_guest.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, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_view_guest.h" 5 #include "content/browser/web_contents/web_contents_view_guest.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "content/browser/browser_plugin/browser_plugin_embedder.h"
8 #include "content/browser/browser_plugin/browser_plugin_guest.h" 9 #include "content/browser/browser_plugin/browser_plugin_guest.h"
9 #include "content/browser/renderer_host/render_view_host_factory.h" 10 #include "content/browser/renderer_host/render_view_host_factory.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 11 #include "content/browser/renderer_host/render_view_host_impl.h"
11 #include "content/browser/renderer_host/render_widget_host_view_guest.h" 12 #include "content/browser/renderer_host/render_widget_host_view_guest.h"
12 #include "content/browser/web_contents/interstitial_page_impl.h" 13 #include "content/browser/web_contents/interstitial_page_impl.h"
13 #include "content/browser/web_contents/web_contents_impl.h" 14 #include "content/browser/web_contents/web_contents_impl.h"
15 #include "content/common/drag_messages.h"
14 #include "content/public/browser/web_contents_delegate.h" 16 #include "content/public/browser/web_contents_delegate.h"
15 #include "ui/gfx/image/image_skia.h" 17 #include "ui/gfx/image/image_skia.h"
16 #include "ui/gfx/point.h" 18 #include "ui/gfx/point.h"
17 #include "ui/gfx/rect.h" 19 #include "ui/gfx/rect.h"
18 #include "ui/gfx/size.h" 20 #include "ui/gfx/size.h"
19 #include "webkit/glue/webdropdata.h" 21 #include "webkit/glue/webdropdata.h"
20 22
21 using WebKit::WebDragOperation; 23 using WebKit::WebDragOperation;
22 using WebKit::WebDragOperationsMask; 24 using WebKit::WebDragOperationsMask;
23 25
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 void WebContentsViewGuest::StoreFocus() { 154 void WebContentsViewGuest::StoreFocus() {
153 platform_view_->StoreFocus(); 155 platform_view_->StoreFocus();
154 } 156 }
155 157
156 WebDropData* WebContentsViewGuest::GetDropData() const { 158 WebDropData* WebContentsViewGuest::GetDropData() const {
157 NOTIMPLEMENTED(); 159 NOTIMPLEMENTED();
158 return NULL; 160 return NULL;
159 } 161 }
160 162
161 void WebContentsViewGuest::UpdateDragCursor(WebDragOperation operation) { 163 void WebContentsViewGuest::UpdateDragCursor(WebDragOperation operation) {
162 NOTIMPLEMENTED(); 164 RenderViewHostImpl* embedder_render_view_host =
165 static_cast<RenderViewHostImpl*>(
166 guest_->embedder_web_contents()->GetRenderViewHost());
167 CHECK(embedder_render_view_host);
168 RenderViewHostDelegateView* view =
169 embedder_render_view_host->GetDelegate()->GetDelegateView();
170 if (view)
171 view->UpdateDragCursor(operation);
163 } 172 }
164 173
165 void WebContentsViewGuest::GotFocus() { 174 void WebContentsViewGuest::GotFocus() {
166 } 175 }
167 176
168 void WebContentsViewGuest::TakeFocus(bool reverse) { 177 void WebContentsViewGuest::TakeFocus(bool reverse) {
169 } 178 }
170 179
171 void WebContentsViewGuest::ShowContextMenu( 180 void WebContentsViewGuest::ShowContextMenu(
172 const ContextMenuParams& params, 181 const ContextMenuParams& params,
(...skipping 11 matching lines...) Expand all
184 // External popup menus are only used on Mac and Android. 193 // External popup menus are only used on Mac and Android.
185 NOTIMPLEMENTED(); 194 NOTIMPLEMENTED();
186 } 195 }
187 196
188 void WebContentsViewGuest::StartDragging( 197 void WebContentsViewGuest::StartDragging(
189 const WebDropData& drop_data, 198 const WebDropData& drop_data,
190 WebDragOperationsMask ops, 199 WebDragOperationsMask ops,
191 const gfx::ImageSkia& image, 200 const gfx::ImageSkia& image,
192 const gfx::Vector2d& image_offset, 201 const gfx::Vector2d& image_offset,
193 const DragEventSourceInfo& event_info) { 202 const DragEventSourceInfo& event_info) {
194 NOTIMPLEMENTED(); 203 WebContentsImpl* embedder_web_contents = guest_->embedder_web_contents();
204 embedder_web_contents->GetBrowserPluginEmbedder()->StartDrag(guest_);
205 RenderViewHostImpl* embedder_render_view_host =
206 static_cast<RenderViewHostImpl*>(
207 embedder_web_contents->GetRenderViewHost());
208 CHECK(embedder_render_view_host);
209 RenderViewHostDelegateView* view =
210 embedder_render_view_host->GetDelegate()->GetDelegateView();
211 if (view)
212 view->StartDragging(drop_data, ops, image, image_offset, event_info);
213 else
214 embedder_web_contents->SystemDragEnded();
195 } 215 }
196 216
197 } // namespace content 217 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_view_aura.cc ('k') | content/browser/web_contents/web_drag_source_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698