diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 15:24:41 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 15:24:41 +0000 |
commit | c27ae599b03a7c30a65c843a8aed99a9e94d284e (patch) | |
tree | dd7a3413fbd5d46b3d9e102b2249c817ef2f9b9a /chrome/renderer | |
parent | b490de133b26e30f8fc5429ff666107cdfdcc117 (diff) | |
download | chromium_src-c27ae599b03a7c30a65c843a8aed99a9e94d284e.zip chromium_src-c27ae599b03a7c30a65c843a8aed99a9e94d284e.tar.gz chromium_src-c27ae599b03a7c30a65c843a8aed99a9e94d284e.tar.bz2 |
Retry r41799:
Basic DragImage implementation.
Only the chromium part is for review. The webkit part shows how that will look when I create the patch for webkit later. This can be landed without the change to webkit.
TODO later:
- use the image on windows, mac
- implement the other DragImageRef functions
TEST=drag an image from the render view in GTK
BUG=11457
Review URL: http://codereview.chromium.org/668125
The problem was an incorrect method signature in RenderView.
Review URL: http://codereview.chromium.org/1037008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41953 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_view.cc | 20 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 7 |
2 files changed, 26 insertions, 1 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index deb5c99..818cbd0 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -82,6 +82,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebFormElement.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/WebKit/chromium/public/WebHistoryItem.h" +#include "third_party/WebKit/WebKit/chromium/public/WebImage.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputElement.h" #include "third_party/WebKit/WebKit/chromium/public/WebNode.h" #include "third_party/WebKit/WebKit/chromium/public/WebNodeList.h" @@ -155,6 +156,7 @@ using WebKit::WebFindOptions; using WebKit::WebFormElement; using WebKit::WebFrame; using WebKit::WebHistoryItem; +using WebKit::WebImage; using WebKit::WebInputElement; using WebKit::WebMediaPlayer; using WebKit::WebMediaPlayerAction; @@ -1908,9 +1910,25 @@ void RenderView::setToolTipText(const WebString& text, WebTextDirection hint) { void RenderView::startDragging(const WebPoint& from, const WebDragData& data, WebDragOperationsMask allowed_ops) { + startDragging(data, allowed_ops, WebImage(), WebPoint()); +} + +void RenderView::startDragging(const WebDragData& data, + WebDragOperationsMask mask, + const WebImage& image, + const WebPoint& imageOffset) { +#if WEBKIT_USING_SKIA + SkBitmap bitmap(image.getSkBitmap()); +#elif WEBKIT_USING_CG + // Needs implementing: http://crbug.com/11457 + SkBitmap bitmap; +#endif + Send(new ViewHostMsg_StartDragging(routing_id_, WebDropData(data), - allowed_ops)); + mask, + bitmap, + imageOffset)); } bool RenderView::acceptsLoadDrops() { diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 618425c..8f7ec80 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -102,12 +102,14 @@ namespace WebKit { class WebAccessibilityCache; class WebDataSource; class WebDragData; +class WebImage; class WebMediaPlayer; class WebMediaPlayerClient; class WebStorageNamespace; class WebURLRequest; struct WebFileChooserParams; struct WebFindOptions; +struct WebPoint; } // We need to prevent a page from trying to create infinite popups. It is not @@ -250,6 +252,11 @@ class RenderView : public RenderWidget, virtual void startDragging( const WebKit::WebPoint& from, const WebKit::WebDragData& data, WebKit::WebDragOperationsMask mask); + virtual void startDragging( + const WebKit::WebDragData& data, + WebKit::WebDragOperationsMask mask, + const WebKit::WebImage& image, + const WebKit::WebPoint& imageOffset); virtual bool acceptsLoadDrops(); virtual void focusNext(); virtual void focusPrevious(); |