OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 WebContents. This represents | 5 // A struct for managing data being dropped on a WebContents. This represents |
6 // a union of all the types of data that can be dropped in a platform neutral | 6 // a union of all the types of data that can be dropped in a platform neutral |
7 // way. | 7 // way. |
8 | 8 |
9 #ifndef CONTENT_PUBLIC_COMMON_DROP_DATA_H_ | 9 #ifndef CONTENT_PUBLIC_COMMON_DROP_DATA_H_ |
10 #define CONTENT_PUBLIC_COMMON_DROP_DATA_H_ | 10 #define CONTENT_PUBLIC_COMMON_DROP_DATA_H_ |
11 | 11 |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <string> | 15 #include <string> |
16 #include <utility> | |
16 #include <vector> | 17 #include <vector> |
17 | 18 |
18 #include "base/strings/nullable_string16.h" | 19 #include "base/strings/nullable_string16.h" |
19 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
20 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 21 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
21 #include "ui/base/dragdrop/file_info.h" | 22 #include "ui/base/dragdrop/file_info.h" |
22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
23 | 24 |
24 namespace content { | 25 namespace content { |
25 | 26 |
27 enum DropDataKind { | |
dcheng
2016/04/19 06:58:47
enum class DropDataKind {
STRING,
FILENAME,
hush (inactive)
2016/05/06 02:25:25
Done. And I put them under DropData class.
| |
28 STRING_KIND = 0, | |
29 FILENAME_KIND, | |
30 FILESYSTEMFILE_KIND, | |
31 DROP_DATA_KIND_LAST = FILESYSTEMFILE_KIND | |
32 }; | |
33 | |
34 typedef std::pair<base::string16, DropDataKind> MimeTypeKindPair; | |
dcheng
2016/04/19 06:58:47
Nit: using MimeTypeKindPair = ...
hush (inactive)
2016/05/06 02:25:25
I removed this because of the complication of file
| |
35 | |
26 struct CONTENT_EXPORT DropData { | 36 struct CONTENT_EXPORT DropData { |
27 struct FileSystemFileInfo { | 37 struct FileSystemFileInfo { |
28 FileSystemFileInfo() : size(0) {} | 38 FileSystemFileInfo() : size(0) {} |
29 ~FileSystemFileInfo() {} | 39 ~FileSystemFileInfo() {} |
30 | 40 |
31 GURL url; | 41 GURL url; |
32 int64_t size; | 42 int64_t size; |
33 }; | 43 }; |
34 | 44 |
35 DropData(); | 45 DropData(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 // User is dragging data from the webview (e.g., an image). | 83 // User is dragging data from the webview (e.g., an image). |
74 base::string16 file_description_filename; | 84 base::string16 file_description_filename; |
75 std::string file_contents; | 85 std::string file_contents; |
76 | 86 |
77 std::map<base::string16, base::string16> custom_data; | 87 std::map<base::string16, base::string16> custom_data; |
78 }; | 88 }; |
79 | 89 |
80 } // namespace content | 90 } // namespace content |
81 | 91 |
82 #endif // CONTENT_PUBLIC_COMMON_DROP_DATA_H_ | 92 #endif // CONTENT_PUBLIC_COMMON_DROP_DATA_H_ |
OLD | NEW |