OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_GLUE_WEB_INTENT_DATA_H_ | 5 #ifndef WEBKIT_GLUE_WEB_INTENT_DATA_H_ |
6 #define WEBKIT_GLUE_WEB_INTENT_DATA_H_ | 6 #define WEBKIT_GLUE_WEB_INTENT_DATA_H_ |
7 | 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/file_path.h" |
8 #include "base/string16.h" | 11 #include "base/string16.h" |
9 #include "webkit/glue/webkit_glue_export.h" | 12 #include "webkit/glue/webkit_glue_export.h" |
10 | 13 |
11 namespace WebKit { | 14 namespace WebKit { |
12 class WebIntent; | 15 class WebIntent; |
13 } | 16 } |
14 | 17 |
15 namespace webkit_glue { | 18 namespace webkit_glue { |
16 | 19 |
17 // Representation of the Web Intent data being initiated or delivered. | 20 // Representation of the Web Intent data being initiated or delivered. |
18 struct WEBKIT_GLUE_EXPORT WebIntentData { | 21 struct WEBKIT_GLUE_EXPORT WebIntentData { |
19 // The action of the intent. | 22 // The action of the intent. |
20 string16 action; | 23 string16 action; |
21 // The MIME type of data in this intent payload. | 24 // The MIME type of data in this intent payload. |
22 string16 type; | 25 string16 type; |
23 // The representation of the payload data. Wire format is from | 26 // The serialized representation of the payload data. Wire format is from |
24 // SerializedScriptObject. | 27 // WebSerializedScriptValue. |
25 string16 data; | 28 string16 data; |
| 29 // Any extra key-value pair metadata. (Not serialized.) |
| 30 std::map<string16, string16> extra_data; |
26 | 31 |
27 // String payload data. | 32 // String payload data. |
28 string16 unserialized_data; | 33 string16 unserialized_data; |
29 | 34 |
| 35 // The file of a payload blob. Together with |blob_length|, suitable |
| 36 // arguments to WebBlob::createFromFile. |
| 37 FilePath blob_file; |
| 38 // Length of the blob. |
| 39 int64 blob_length; |
| 40 |
30 // These enum values indicate which payload data type should be used. | 41 // These enum values indicate which payload data type should be used. |
31 enum DataType { | 42 enum DataType { |
32 SERIALIZED = 0, // The payload is serialized in |data|. | 43 SERIALIZED = 0, // The payload is serialized in |data|. |
33 UNSERIALIZED = 1 // The payload is unseriazed in |unserialized_data|. | 44 UNSERIALIZED = 1, // The payload is unserialized in |unserialized_data|. |
| 45 BLOB = 2 // The payload is a blob |
34 }; | 46 }; |
35 // Which data payload to use when delivering the intent. | 47 // Which data payload to use when delivering the intent. |
36 DataType data_type; | 48 DataType data_type; |
37 | 49 |
38 WebIntentData(); | 50 WebIntentData(); |
39 WebIntentData(const WebKit::WebIntent& intent); | 51 WebIntentData(const WebKit::WebIntent& intent); |
40 WebIntentData(const string16& action_in, | 52 WebIntentData(const string16& action_in, |
41 const string16& type_in, | 53 const string16& type_in, |
42 const string16& unserialized_data_in); | 54 const string16& unserialized_data_in); |
| 55 WebIntentData(const string16& action_in, |
| 56 const string16& type_in, |
| 57 const FilePath& blob_file_in, |
| 58 int64 blob_length_in); |
43 ~WebIntentData(); | 59 ~WebIntentData(); |
44 }; | 60 }; |
45 | 61 |
46 } // namespace webkit_glue | 62 } // namespace webkit_glue |
47 | 63 |
48 #endif // WEBKIT_GLUE_WEB_INTENT_DATA_H_ | 64 #endif // WEBKIT_GLUE_WEB_INTENT_DATA_H_ |
OLD | NEW |