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

Unified Diff: chrome/browser/ui/gtk/custom_drag.h

Issue 23646006: gtk: Split CustomDrag into multiple pieces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_drag_drop_gtk.cc ('k') | chrome/browser/ui/gtk/custom_drag.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/custom_drag.h
diff --git a/chrome/browser/ui/gtk/custom_drag.h b/chrome/browser/ui/gtk/custom_drag.h
index 788325b37d713be6d1541deee8a7bc47e5d3843d..06a91d42d3d1ffe7f3daefc3880b6e88ed12ca59 100644
--- a/chrome/browser/ui/gtk/custom_drag.h
+++ b/chrome/browser/ui/gtk/custom_drag.h
@@ -6,20 +6,10 @@
#define CHROME_BROWSER_UI_GTK_CUSTOM_DRAG_H_
#include <gtk/gtk.h>
-#include <vector>
#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
#include "ui/base/gtk/gtk_signal.h"
-class BookmarkNode;
-class Profile;
-
-namespace content {
-class DownloadItem;
-}
-
namespace gfx {
class Image;
}
@@ -30,9 +20,11 @@ class CustomDrag {
CustomDrag(gfx::Image* icon, int code_mask, GdkDragAction action);
virtual ~CustomDrag();
- virtual void OnDragDataGet(GtkWidget* widget, GdkDragContext* context,
+ virtual void OnDragDataGet(GtkWidget* widget,
+ GdkDragContext* context,
GtkSelectionData* selection_data,
- guint target_type, guint time) = 0;
+ guint target_type,
+ guint time) = 0;
private:
CHROMEGTK_CALLBACK_1(CustomDrag, void, OnDragBegin, GdkDragContext*);
@@ -58,56 +50,4 @@ class CustomDrag {
DISALLOW_COPY_AND_ASSIGN(CustomDrag);
};
-// Encapsulates functionality for drags of download items.
-class DownloadItemDrag : public CustomDrag {
- public:
- // Sets |widget| as a source for drags pertaining to |item|. No
- // DownloadItemDrag object is created.
- // It is safe to call this multiple times with different values of |icon|.
- static void SetSource(GtkWidget* widget,
- const content::DownloadItem* item,
- gfx::Image* icon);
-
- // Creates a new DownloadItemDrag, the lifetime of which is tied to the
- // system drag.
- static void BeginDrag(const content::DownloadItem* item, gfx::Image* icon);
-
- private:
- class DragData;
-
- DownloadItemDrag(const content::DownloadItem* item, gfx::Image* icon);
- virtual ~DownloadItemDrag();
-
- virtual void OnDragDataGet(GtkWidget* widget, GdkDragContext* context,
- GtkSelectionData* selection_data,
- guint target_type, guint time) OVERRIDE;
-
- scoped_ptr<DragData> drag_data_;
-
- DISALLOW_COPY_AND_ASSIGN(DownloadItemDrag);
-};
-
-// Encapsulates functionality for drags of one or more bookmarks.
-class BookmarkDrag : public CustomDrag {
- public:
- // Creates a new BookmarkDrag, the lifetime of which is tied to the
- // system drag.
- static void BeginDrag(Profile* profile,
- const std::vector<const BookmarkNode*>& nodes);
-
- private:
- BookmarkDrag(Profile* profile,
- const std::vector<const BookmarkNode*>& nodes);
- virtual ~BookmarkDrag();
-
- virtual void OnDragDataGet(GtkWidget* widget, GdkDragContext* context,
- GtkSelectionData* selection_data,
- guint target_type, guint time) OVERRIDE;
-
- Profile* profile_;
- std::vector<const BookmarkNode*> nodes_;
-
- DISALLOW_COPY_AND_ASSIGN(BookmarkDrag);
-};
-
#endif // CHROME_BROWSER_UI_GTK_CUSTOM_DRAG_H_
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_drag_drop_gtk.cc ('k') | chrome/browser/ui/gtk/custom_drag.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698