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

Side by Side 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, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_DRAG_H_
6 #define CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_DRAG_H_
7
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"
12
13 namespace content {
14 class DownloadItem;
15 }
16
17 // Encapsulates functionality for drags of download items.
18 class DownloadItemDrag : public CustomDrag {
19 public:
20 // Sets |widget| as a source for drags pertaining to |item|. No
21 // DownloadItemDrag object is created.
22 // It is safe to call this multiple times with different values of |icon|.
23 static void SetSource(GtkWidget* widget,
24 const content::DownloadItem* item,
25 gfx::Image* icon);
26
27 // Creates a new DownloadItemDrag, the lifetime of which is tied to the
28 // system drag.
29 static void BeginDrag(const content::DownloadItem* item, gfx::Image* icon);
30
31 private:
32 class DragData;
33
34 DownloadItemDrag(const content::DownloadItem* item, gfx::Image* icon);
35 virtual ~DownloadItemDrag();
36
37 virtual void OnDragDataGet(GtkWidget* widget,
38 GdkDragContext* context,
39 GtkSelectionData* selection_data,
40 guint target_type,
41 guint time) OVERRIDE;
42
43 scoped_ptr<DragData> drag_data_;
44
45 DISALLOW_COPY_AND_ASSIGN(DownloadItemDrag);
46 };
47
48
49 #endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_DRAG_H_
OLDNEW
« 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