OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 APP_GTK_DND_UTIL_H_ | 5 #ifndef APP_GTK_DND_UTIL_H_ |
6 #define APP_GTK_DND_UTIL_H_ | 6 #define APP_GTK_DND_UTIL_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "third_party/WebKit/WebKit/chromium/public/WebDragOperation.h" |
13 | 14 |
14 class GURL; | 15 class GURL; |
15 | 16 |
16 namespace gtk_dnd_util { | 17 namespace gtk_dnd_util { |
17 | 18 |
18 // Registry of all internal int codes for drag and drop. | 19 // Registry of all internal int codes for drag and drop. |
19 enum { | 20 enum { |
20 // Intra-application types. | 21 // Intra-application types. |
21 CHROME_TAB = 1 << 0, | 22 CHROME_TAB = 1 << 0, |
22 CHROME_BOOKMARK_ITEM = 1 << 1, | 23 CHROME_BOOKMARK_ITEM = 1 << 1, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // |url| and |title|. Returns true if the url/title were safely extracted | 71 // |url| and |title|. Returns true if the url/title were safely extracted |
71 // and the url is valid. | 72 // and the url is valid. |
72 bool ExtractNamedURL(GtkSelectionData* selection_data, | 73 bool ExtractNamedURL(GtkSelectionData* selection_data, |
73 GURL* url, | 74 GURL* url, |
74 string16* title); | 75 string16* title); |
75 | 76 |
76 // Extracts data of type TEXT_URI_LIST from |selection_data| into |urls|. | 77 // Extracts data of type TEXT_URI_LIST from |selection_data| into |urls|. |
77 bool ExtractURIList(GtkSelectionData* selection_data, | 78 bool ExtractURIList(GtkSelectionData* selection_data, |
78 std::vector<GURL>* urls); | 79 std::vector<GURL>* urls); |
79 | 80 |
| 81 // Convenience method for converting between a web drag operation and the GDK |
| 82 // equivalent. |
| 83 GdkDragAction WebDragOpToGdkDragAction(WebKit::WebDragOperationsMask op); |
| 84 |
80 } // namespace gtk_dnd_util | 85 } // namespace gtk_dnd_util |
81 | 86 |
82 #endif // APP_GTK_DND_UTIL_H_ | 87 #endif // APP_GTK_DND_UTIL_H_ |
OLD | NEW |