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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // corresponds to |code_mask|. | 57 // corresponds to |code_mask|. |
58 void SetSourceTargetListFromCodeMask(GtkWidget* source, int code_mask); | 58 void SetSourceTargetListFromCodeMask(GtkWidget* source, int code_mask); |
59 | 59 |
60 // Set the accepted targets list for |dest|. The |target_codes| array should | 60 // Set the accepted targets list for |dest|. The |target_codes| array should |
61 // be sorted in preference order and should be terminated with -1. | 61 // be sorted in preference order and should be terminated with -1. |
62 void SetDestTargetList(GtkWidget* dest, const int* target_codes); | 62 void SetDestTargetList(GtkWidget* dest, const int* target_codes); |
63 | 63 |
64 // Write a URL to the selection in the given type. | 64 // Write a URL to the selection in the given type. |
65 void WriteURLWithName(GtkSelectionData* selection_data, | 65 void WriteURLWithName(GtkSelectionData* selection_data, |
66 const GURL& url, | 66 const GURL& url, |
67 const string16& title, | 67 string16 title, |
68 int type); | 68 int type); |
69 | 69 |
70 // Extracts data of type CHROME_NAMED_URL from |selection_data| into | 70 // Extracts data of type CHROME_NAMED_URL from |selection_data| into |
71 // |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 |
72 // and the url is valid. | 72 // and the url is valid. |
73 bool ExtractNamedURL(GtkSelectionData* selection_data, | 73 bool ExtractNamedURL(GtkSelectionData* selection_data, |
74 GURL* url, | 74 GURL* url, |
75 string16* title); | 75 string16* title); |
76 | 76 |
77 // 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|. |
78 bool ExtractURIList(GtkSelectionData* selection_data, | 78 bool ExtractURIList(GtkSelectionData* selection_data, |
79 std::vector<GURL>* urls); | 79 std::vector<GURL>* urls); |
80 | 80 |
81 } // namespace gtk_dnd_util | 81 } // namespace gtk_dnd_util |
82 | 82 |
83 #endif // APP_GTK_DND_UTIL_H_ | 83 #endif // APP_GTK_DND_UTIL_H_ |
OLD | NEW |