OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
8 #include "base/string16.h" | 10 #include "base/string16.h" |
9 #include "webkit/glue/webkit_glue_export.h" | 11 #include "webkit/glue/webkit_glue_export.h" |
10 | 12 |
11 namespace WebKit { | 13 namespace WebKit { |
12 class WebIntent; | 14 class WebIntent; |
13 } | 15 } |
14 | 16 |
15 namespace webkit_glue { | 17 namespace webkit_glue { |
16 | 18 |
17 // Representation of the Web Intent data being initiated or delivered. | 19 // Representation of the Web Intent data being initiated or delivered. |
18 struct WEBKIT_GLUE_EXPORT WebIntentData { | 20 struct WEBKIT_GLUE_EXPORT WebIntentData { |
19 // The action of the intent. | 21 // The action of the intent. |
20 string16 action; | 22 string16 action; |
21 // The MIME type of data in this intent payload. | 23 // The MIME type of data in this intent payload. |
22 string16 type; | 24 string16 type; |
23 // The representation of the payload data. Wire format is from | 25 // The representation of the payload data. Wire format is from |
24 // SerializedScriptObject. | 26 // SerializedScriptObject. |
25 string16 data; | 27 string16 data; |
26 | 28 |
| 29 // Any extra key-value pair metadata. |
| 30 std::map<string16, string16> extra_data; |
| 31 |
| 32 // String payload data. |
| 33 string16 unserialized_data; |
| 34 |
| 35 // The filename containing a payload blob. (UTF8) |
| 36 std::string blob_file; |
| 37 // Length of the blob. |
| 38 int64 blob_length; |
| 39 |
| 40 enum { |
| 41 SERIALIZED = 0, |
| 42 UNSERIALIZED = 1, |
| 43 BLOB = 2 |
| 44 }; |
| 45 int data_type; |
| 46 |
27 WebIntentData(); | 47 WebIntentData(); |
28 WebIntentData(const WebKit::WebIntent& intent); | 48 WebIntentData(const WebKit::WebIntent& intent); |
| 49 WebIntentData(const string16& action_in, |
| 50 const string16& type_in, |
| 51 const string16& unserialized_data_in); |
| 52 WebIntentData(const string16& action_in, |
| 53 const string16& type_in, |
| 54 const std::string& blob_file_in, |
| 55 int64 blob_length_in); |
29 ~WebIntentData(); | 56 ~WebIntentData(); |
30 }; | 57 }; |
31 | 58 |
32 } // namespace webkit_glue | 59 } // namespace webkit_glue |
33 | 60 |
34 #endif // WEBKIT_GLUE_WEB_INTENT_DATA_H_ | 61 #endif // WEBKIT_GLUE_WEB_INTENT_DATA_H_ |
OLD | NEW |