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/browser/views/tab_contents | |
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/browser/views/tab_contents')
4 files changed, 23 insertions, 5 deletions
diff --git a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc index 91b25ce..4a9870e 100644 --- a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc +++ b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc @@ -219,8 +219,11 @@ void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { } void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, - WebDragOperationsMask ops) { - drag_source_->StartDragging(drop_data, &last_mouse_down_); + WebDragOperationsMask ops, + const SkBitmap& image, + const gfx::Point& image_offset) { + drag_source_->StartDragging(drop_data, &last_mouse_down_, + image, image_offset); // TODO(snej): Make use of WebDragOperationsMask } diff --git a/chrome/browser/views/tab_contents/tab_contents_view_gtk.h b/chrome/browser/views/tab_contents/tab_contents_view_gtk.h index 3439ec5..e88c3f9 100644 --- a/chrome/browser/views/tab_contents/tab_contents_view_gtk.h +++ b/chrome/browser/views/tab_contents/tab_contents_view_gtk.h @@ -16,8 +16,12 @@ class ConstrainedWindowGtk; typedef struct _GtkFloatingContainer GtkFloatingContainer; class RenderViewContextMenuGtk; class SadTabView; +class SkBitmap; class TabContentsDragSource; class WebDragDestGtk; +namespace gfx { +class Point; +} namespace views { class NativeViewHost; } @@ -61,7 +65,9 @@ class TabContentsViewGtk : public TabContentsView, // Backend implementation of RenderViewHostDelegate::View. virtual void ShowContextMenu(const ContextMenuParams& params); virtual void StartDragging(const WebDropData& drop_data, - WebKit::WebDragOperationsMask ops_allowed); + WebKit::WebDragOperationsMask ops_allowed, + const SkBitmap& image, + const gfx::Point& image_offset); virtual void UpdateDragCursor(WebKit::WebDragOperation operation); virtual void GotFocus(); virtual void TakeFocus(bool reverse); diff --git a/chrome/browser/views/tab_contents/tab_contents_view_win.cc b/chrome/browser/views/tab_contents/tab_contents_view_win.cc index 5af44c6..243017e 100644 --- a/chrome/browser/views/tab_contents/tab_contents_view_win.cc +++ b/chrome/browser/views/tab_contents/tab_contents_view_win.cc @@ -125,8 +125,11 @@ void TabContentsViewWin::GetContainerBounds(gfx::Rect* out) const { } void TabContentsViewWin::StartDragging(const WebDropData& drop_data, - WebDragOperationsMask ops) { + WebDragOperationsMask ops, + const SkBitmap& image, + const gfx::Point& image_offset) { drag_handler_ = new TabContentsDragWin(this); + // TODO(estade): make use of |image| and |image_offset|. drag_handler_->StartDragging(drop_data, ops); } diff --git a/chrome/browser/views/tab_contents/tab_contents_view_win.h b/chrome/browser/views/tab_contents/tab_contents_view_win.h index 61177bc..27f50fe 100644 --- a/chrome/browser/views/tab_contents/tab_contents_view_win.h +++ b/chrome/browser/views/tab_contents/tab_contents_view_win.h @@ -13,10 +13,14 @@ class RenderViewContextMenuWin; class SadTabView; +class SkBitmap; class TabContentsDragWin; struct WebDropData; class WebDragSource; class WebDropTarget; +namespace gfx { +class Point; +} // Windows-specific implementation of the TabContentsView. It is a HWND that // contains all of the contents of the tab and associated child views. @@ -55,7 +59,9 @@ class TabContentsViewWin : public TabContentsView, // Backend implementation of RenderViewHostDelegate::View. virtual void ShowContextMenu(const ContextMenuParams& params); virtual void StartDragging(const WebDropData& drop_data, - WebKit::WebDragOperationsMask operations); + WebKit::WebDragOperationsMask operations, + const SkBitmap& image, + const gfx::Point& image_offset); virtual void UpdateDragCursor(WebKit::WebDragOperation operation); virtual void GotFocus(); virtual void TakeFocus(bool reverse); |