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

Unified Diff: chrome/browser/ui/gtk/download/download_item_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/custom_drag.cc ('k') | chrome/browser/ui/gtk/download/download_item_drag.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/download/download_item_drag.h
diff --git a/chrome/browser/ui/gtk/download/download_item_drag.h b/chrome/browser/ui/gtk/download/download_item_drag.h
new file mode 100644
index 0000000000000000000000000000000000000000..9e626c70e418e7f244a7d96068fd99d08f136354
--- /dev/null
+++ b/chrome/browser/ui/gtk/download/download_item_drag.h
@@ -0,0 +1,49 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_DRAG_H_
+#define CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_DRAG_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/gtk/custom_drag.h"
+
+namespace content {
+class DownloadItem;
+}
+
+// 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);
+};
+
+
+#endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_DRAG_H_
« no previous file with comments | « chrome/browser/ui/gtk/custom_drag.cc ('k') | chrome/browser/ui/gtk/download/download_item_drag.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698