diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-19 00:36:58 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-19 00:36:58 +0000 |
commit | 8ada5e06e95dd941314a0665da2948448fefa820 (patch) | |
tree | a76c5f54eaf16c29f595af2b76d5e5c2e0327b07 /chrome/browser/gtk/tab_contents_drag_source.h | |
parent | 595d56c647fc96cc9b6a5b8ec5b4787e719f981c (diff) | |
download | chromium_src-8ada5e06e95dd941314a0665da2948448fefa820.zip chromium_src-8ada5e06e95dd941314a0665da2948448fefa820.tar.gz chromium_src-8ada5e06e95dd941314a0665da2948448fefa820.tar.bz2 |
Support dragging a virtual file out of the browser on Linux. This is based on the discussion of drag-out feature on whatwg: http://list.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-August/022122.html
BUG=none
TEST=To test, drag an element that adds the DownloadURL format data via event.DataTransfer.setData, to the desktop or a folder.
Review URL: http://codereview.chromium.org/600154
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39405 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tab_contents_drag_source.h')
-rw-r--r-- | chrome/browser/gtk/tab_contents_drag_source.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/chrome/browser/gtk/tab_contents_drag_source.h b/chrome/browser/gtk/tab_contents_drag_source.h index 8a81647..edef7ad 100644 --- a/chrome/browser/gtk/tab_contents_drag_source.h +++ b/chrome/browser/gtk/tab_contents_drag_source.h @@ -9,7 +9,10 @@ #include "app/gfx/native_widget_types.h" #include "base/basictypes.h" +#include "base/file_path.h" #include "base/message_loop.h" +#include "base/string16.h" +#include "googleurl/src/gurl.h" #include "third_party/WebKit/WebKit/chromium/public/WebDragOperation.h" class TabContents; @@ -42,13 +45,20 @@ class TabContentsDragSource : public MessageLoopForUI::Observer { return handler->OnDragFailed(); } gboolean OnDragFailed(); + static void OnDragBeginThunk(GtkWidget* widget, + GdkDragContext* drag_context, + TabContentsDragSource* handler) { + handler->OnDragBegin(drag_context); + } + void OnDragBegin(GdkDragContext* drag_context); static void OnDragEndThunk(GtkWidget* widget, GdkDragContext* drag_context, TabContentsDragSource* handler) { - handler->OnDragEnd(WebKit::WebDragOperationCopy); + handler->OnDragEnd(drag_context, WebKit::WebDragOperationCopy); // TODO(snej): Pass actual operation instead of hardcoding copy } - void OnDragEnd(WebKit::WebDragOperation operation); + void OnDragEnd(GdkDragContext* drag_context, + WebKit::WebDragOperation operation); static void OnDragDataGetThunk(GtkWidget* drag_widget, GdkDragContext* context, GtkSelectionData* selection_data, @@ -81,6 +91,15 @@ class TabContentsDragSource : public MessageLoopForUI::Observer { // out. GtkWidget* drag_widget_; + // The file mime type for a drag-out download. + string16 wide_download_mime_type_; + + // The file name to be saved to for a drag-out download. + FilePath download_file_name_; + + // The URL to download from for a drag-out download. + GURL download_url_; + DISALLOW_COPY_AND_ASSIGN(TabContentsDragSource); }; |