summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/tab_contents_drag_source.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-08 18:39:52 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-08 18:39:52 +0000
commitd02a21b84b9829a46e22466ebcd64da93c9479de (patch)
tree31974a653f6a0e5e90c3ec3bf066a6c9e5d17204 /chrome/browser/gtk/tab_contents_drag_source.h
parent9d05f7f84520083b1ac0afb85733ba5d32e89f50 (diff)
downloadchromium_src-d02a21b84b9829a46e22466ebcd64da93c9479de.zip
chromium_src-d02a21b84b9829a46e22466ebcd64da93c9479de.tar.gz
chromium_src-d02a21b84b9829a46e22466ebcd64da93c9479de.tar.bz2
GTK: slightly change how we display drag images.
We use a popup window for the drag because in many window managers it looks better. Ideally we would implement the alpha-channel fading that some other WebKit ports use, but gtk_drag_set_icon_* don't seem to support transparency (dragged tabs can be transparent because they use a different approach that avoids this problem, but is more complicated in other ways). BUG=none TEST=manual Review URL: http://codereview.chromium.org/1519019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43976 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.h44
1 files changed, 14 insertions, 30 deletions
diff --git a/chrome/browser/gtk/tab_contents_drag_source.h b/chrome/browser/gtk/tab_contents_drag_source.h
index 423f895..fbfaeee 100644
--- a/chrome/browser/gtk/tab_contents_drag_source.h
+++ b/chrome/browser/gtk/tab_contents_drag_source.h
@@ -7,6 +7,7 @@
#include <gtk/gtk.h>
+#include "app/gtk_signal.h"
#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/message_loop.h"
@@ -43,36 +44,14 @@ class TabContentsDragSource : public MessageLoopForUI::Observer {
virtual void DidProcessEvent(GdkEvent* event);
private:
- static gboolean OnDragFailedThunk(GtkWidget* widget,
- GdkDragContext* drag_context,
- GtkDragResult result,
- TabContentsDragSource* handler) {
- 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(drag_context, drag_context->action);
- }
- void OnDragEnd(GdkDragContext* drag_context,
- GdkDragAction operation);
- static void OnDragDataGetThunk(GtkWidget* drag_widget,
- GdkDragContext* context,
- GtkSelectionData* selection_data,
- guint target_type,
- guint time,
- TabContentsDragSource* handler) {
- handler->OnDragDataGet(context, selection_data, target_type, time);
- }
- void OnDragDataGet(GdkDragContext* context, GtkSelectionData* selection_data,
- guint target_type, guint time);
+ CHROMEGTK_CALLBACK_2(TabContentsDragSource, gboolean, OnDragFailed,
+ GdkDragContext*, GtkDragResult);
+ CHROMEGTK_CALLBACK_1(TabContentsDragSource, void, OnDragBegin,
+ GdkDragContext*);
+ CHROMEGTK_CALLBACK_1(TabContentsDragSource, void, OnDragEnd,
+ GdkDragContext*);
+ CHROMEGTK_CALLBACK_4(TabContentsDragSource, void, OnDragDataGet,
+ GdkDragContext*, GtkSelectionData*, guint, guint);
gfx::NativeView GetContentNativeView() const;
@@ -109,6 +88,11 @@ class TabContentsDragSource : public MessageLoopForUI::Observer {
// The URL to download from for a drag-out download.
GURL download_url_;
+ // The widget that provides visual feedback for the drag. We use this instead
+ // of gtk_drag_set_icon_pixbuf() because some window managers will use shadows
+ // or other visual effects on top level windows.
+ GtkWidget* drag_icon_;
+
DISALLOW_COPY_AND_ASSIGN(TabContentsDragSource);
};