OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_GTK_CUSTOM_DRAG_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_CUSTOM_DRAG_H_ |
6 #define CHROME_BROWSER_UI_GTK_CUSTOM_DRAG_H_ | 6 #define CHROME_BROWSER_UI_GTK_CUSTOM_DRAG_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" |
13 #include "ui/base/gtk/gtk_signal.h" | 14 #include "ui/base/gtk/gtk_signal.h" |
14 | 15 |
15 class BookmarkNode; | 16 class BookmarkNode; |
16 class DownloadItem; | 17 class DownloadItem; |
17 class Profile; | 18 class Profile; |
18 | 19 |
19 namespace gfx { | 20 namespace gfx { |
20 class Image; | 21 class Image; |
21 } | 22 } |
22 | 23 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Creates a new DownloadItemDrag, the lifetime of which is tied to the | 68 // Creates a new DownloadItemDrag, the lifetime of which is tied to the |
68 // system drag. | 69 // system drag. |
69 static void BeginDrag(const DownloadItem* item, gfx::Image* icon); | 70 static void BeginDrag(const DownloadItem* item, gfx::Image* icon); |
70 | 71 |
71 private: | 72 private: |
72 DownloadItemDrag(const DownloadItem* item, gfx::Image* icon); | 73 DownloadItemDrag(const DownloadItem* item, gfx::Image* icon); |
73 virtual ~DownloadItemDrag(); | 74 virtual ~DownloadItemDrag(); |
74 | 75 |
75 virtual void OnDragDataGet(GtkWidget* widget, GdkDragContext* context, | 76 virtual void OnDragDataGet(GtkWidget* widget, GdkDragContext* context, |
76 GtkSelectionData* selection_data, | 77 GtkSelectionData* selection_data, |
77 guint target_type, guint time); | 78 guint target_type, guint time) OVERRIDE; |
78 | 79 |
79 const DownloadItem* download_item_; | 80 const DownloadItem* download_item_; |
80 | 81 |
81 DISALLOW_COPY_AND_ASSIGN(DownloadItemDrag); | 82 DISALLOW_COPY_AND_ASSIGN(DownloadItemDrag); |
82 }; | 83 }; |
83 | 84 |
84 // Encapsulates functionality for drags of one or more bookmarks. | 85 // Encapsulates functionality for drags of one or more bookmarks. |
85 class BookmarkDrag : public CustomDrag { | 86 class BookmarkDrag : public CustomDrag { |
86 public: | 87 public: |
87 // Creates a new BookmarkDrag, the lifetime of which is tied to the | 88 // Creates a new BookmarkDrag, the lifetime of which is tied to the |
88 // system drag. | 89 // system drag. |
89 static void BeginDrag(Profile* profile, | 90 static void BeginDrag(Profile* profile, |
90 const std::vector<const BookmarkNode*>& nodes); | 91 const std::vector<const BookmarkNode*>& nodes); |
91 | 92 |
92 private: | 93 private: |
93 BookmarkDrag(Profile* profile, | 94 BookmarkDrag(Profile* profile, |
94 const std::vector<const BookmarkNode*>& nodes); | 95 const std::vector<const BookmarkNode*>& nodes); |
95 virtual ~BookmarkDrag(); | 96 virtual ~BookmarkDrag(); |
96 | 97 |
97 virtual void OnDragDataGet(GtkWidget* widget, GdkDragContext* context, | 98 virtual void OnDragDataGet(GtkWidget* widget, GdkDragContext* context, |
98 GtkSelectionData* selection_data, | 99 GtkSelectionData* selection_data, |
99 guint target_type, guint time); | 100 guint target_type, guint time) OVERRIDE; |
100 | 101 |
101 Profile* profile_; | 102 Profile* profile_; |
102 std::vector<const BookmarkNode*> nodes_; | 103 std::vector<const BookmarkNode*> nodes_; |
103 | 104 |
104 DISALLOW_COPY_AND_ASSIGN(BookmarkDrag); | 105 DISALLOW_COPY_AND_ASSIGN(BookmarkDrag); |
105 }; | 106 }; |
106 | 107 |
107 #endif // CHROME_BROWSER_UI_GTK_CUSTOM_DRAG_H_ | 108 #endif // CHROME_BROWSER_UI_GTK_CUSTOM_DRAG_H_ |
OLD | NEW |