OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // A struct for managing data being dropped on a webview. This represents a | 5 // A struct for managing data being dropped on a webview. This represents a |
6 // union of all the types of data that can be dropped in a platform neutral | 6 // union of all the types of data that can be dropped in a platform neutral |
7 // way. | 7 // way. |
8 | 8 |
9 #ifndef WEBKIT_GLUE_WEBDROPDATA_H_ | 9 #ifndef WEBKIT_GLUE_WEBDROPDATA_H_ |
10 #define WEBKIT_GLUE_WEBDROPDATA_H_ | 10 #define WEBKIT_GLUE_WEBDROPDATA_H_ |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 | 15 |
16 struct IDataObject; | 16 struct IDataObject; |
17 | 17 |
18 struct WebDropData { | 18 struct WebDropData { |
19 // User is dropping a link on the webview. | 19 // User is dropping a link on the webview. |
20 GURL url; | 20 GURL url; |
21 std::wstring url_title; // The title associated with |url|. | 21 std::wstring url_title; // The title associated with |url|. |
22 | 22 |
23 // User is dropping one or more files on the webview. | 23 // User is dropping one or more files on the webview. |
24 std::vector<std::wstring> filenames; | 24 std::vector<std::wstring> filenames; |
25 | 25 |
26 // User is dragging plain text into the webview. | 26 // User is dragging plain text into the webview. |
27 std::wstring plain_text; | 27 std::wstring plain_text; |
28 | 28 |
29 // User is dragging MS HTML into the webview (e.g., out of IE). | 29 // User is dragging text/html into the webview (e.g., out of Firefox). |
30 // TODO(tc): We should remove this from webdropdata because not all platforms | 30 // |html_base_url| is the URL that the html fragment is taken from (used to |
31 // have cf_html. On the browser side, we should do the necessary conversions | 31 // resolve relative links). It's ok for |html_base_url| to be empty. |
32 // so we still support cf_html. | |
33 std::wstring cf_html; | |
34 | |
35 // User is dragging text/html into the webview (e.g., out of Firefox). | |
36 std::wstring text_html; | 32 std::wstring text_html; |
| 33 GURL html_base_url; |
37 | 34 |
38 // User is dragging data from the webview (e.g., an image). | 35 // User is dragging data from the webview (e.g., an image). |
39 std::wstring file_description_filename; | 36 std::wstring file_description_filename; |
40 std::string file_contents; | 37 std::string file_contents; |
41 | 38 |
42 // Helper method for converting Window's specific IDataObject to a WebDropData | 39 // Helper method for converting Window's specific IDataObject to a WebDropData |
43 // object. TODO(tc): Move this to the browser side since it's Windows | 40 // object. TODO(tc): Move this to the browser side since it's Windows |
44 // specific and no longer used in webkit. | 41 // specific and no longer used in webkit. |
45 static void PopulateWebDropData(IDataObject* data_object, | 42 static void PopulateWebDropData(IDataObject* data_object, |
46 WebDropData* drop_data); | 43 WebDropData* drop_data); |
47 }; | 44 }; |
48 | 45 |
49 #endif // WEBKIT_GLUE_WEBDROPDATA_H_ | 46 #endif // WEBKIT_GLUE_WEBDROPDATA_H_ |
OLD | NEW |