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 // TODO(gbillock): need to add a num_message_ports_in_data field |
| 30 |
| 31 // Any extra key-value pair metadata. |
| 32 std::map<string16, string16> extra_data; |
| 33 |
| 34 // String payload data. |
| 35 string16 unserialized_data; |
| 36 |
| 37 // The URL of a payload blob. |
| 38 string16 blob_url; |
| 39 // Length of the blob. |
| 40 int blob_length; |
| 41 |
| 42 enum { |
| 43 SERIALIZED = 0, |
| 44 UNSERIALIZED = 1, |
| 45 BLOB = 2 |
| 46 }; |
| 47 int data_type; |
| 48 |
27 WebIntentData(); | 49 WebIntentData(); |
28 WebIntentData(const WebKit::WebIntent& intent); | 50 WebIntentData(const WebKit::WebIntent& intent); |
| 51 WebIntentData(const string16& action_in, |
| 52 const string16& type_in, |
| 53 const string16& unserialized_data_in); |
| 54 WebIntentData(const string16& action_in, |
| 55 const string16& type_in, |
| 56 const string16& blob_url_in, |
| 57 int blob_length_in); |
29 ~WebIntentData(); | 58 ~WebIntentData(); |
30 }; | 59 }; |
31 | 60 |
| 61 struct WEBKIT_GLUE_EXPORT WebIntentUnserializedData { |
| 62 // The action of the intent. |
| 63 string16 action; |
| 64 // The MIME type of data in this intent payload. |
| 65 string16 type; |
| 66 |
| 67 // Any extra key-value pair metadata. |
| 68 std::map<string16, string16> extra_data; |
| 69 |
| 70 // String payload data. |
| 71 string16 unserialized_data; |
| 72 |
| 73 // The URL of a payload blob. |
| 74 string16 blob_url; |
| 75 // Length of the blob. |
| 76 int blob_length; |
| 77 |
| 78 WebIntentUnserializedData(); |
| 79 ~WebIntentUnserializedData(); |
| 80 }; |
| 81 |
32 } // namespace webkit_glue | 82 } // namespace webkit_glue |
33 | 83 |
34 #endif // WEBKIT_GLUE_WEB_INTENT_DATA_H_ | 84 #endif // WEBKIT_GLUE_WEB_INTENT_DATA_H_ |
OLD | NEW |