1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_DRAG_H_
6 #define CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_DRAG_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/ui/gtk/custom_drag.h"
17 // Encapsulates functionality for drags of download items.
18 class DownloadItemDrag : public CustomDrag {
20 DownloadItemDrag(const content::DownloadItem* item, gfx::Image* icon);
22 // Sets |widget| as a source for drags pertaining to |item|. No
23 // DownloadItemDrag object is created.
24 // It is safe to call this multiple times with different values of |icon|.
25 static void SetSource(GtkWidget* widget,
26 const content::DownloadItem* item,
32 virtual ~DownloadItemDrag();
34 virtual void OnDragDataGet(GtkWidget* widget,
35 GdkDragContext* context,
36 GtkSelectionData* selection_data,
40 scoped_ptr<DragData> drag_data_;
42 DISALLOW_COPY_AND_ASSIGN(DownloadItemDrag);
46 #endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_DRAG_H_