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 "base/string16.h" | 8 #include "base/string16.h" |
9 #include "webkit/glue/webkit_glue_export.h" | 9 #include "webkit/glue/webkit_glue_export.h" |
10 | 10 |
11 namespace WebKit { | 11 namespace WebKit { |
12 class WebIntent; | 12 class WebIntent; |
13 } | 13 } |
14 | 14 |
15 namespace webkit_glue { | 15 namespace webkit_glue { |
16 | 16 |
17 // Representation of the Web Intent data being initiated or delivered. | 17 // Representation of the Web Intent data being initiated or delivered. |
18 struct WEBKIT_GLUE_EXPORT WebIntentData { | 18 struct WEBKIT_GLUE_EXPORT WebIntentData { |
19 // The action of the intent. | 19 // The action of the intent. |
20 string16 action; | 20 string16 action; |
21 // The MIME type of data in this intent payload. | 21 // The MIME type of data in this intent payload. |
22 string16 type; | 22 string16 type; |
23 // The representation of the payload data. Wire format is from | 23 // The representation of the payload data. Wire format is from |
24 // SerializedScriptObject. | 24 // SerializedScriptObject. |
25 string16 data; | 25 string16 data; |
26 | 26 |
| 27 // String payload data. |
| 28 string16 unserialized_data; |
| 29 |
| 30 // These enum values indicate which payload data type should be used. |
| 31 enum DataType { |
| 32 SERIALIZED = 0, // The payload is serialized in |data|. |
| 33 UNSERIALIZED = 1 // The payload is unseriazed in |unserialized_data|. |
| 34 }; |
| 35 // Which data payload to use when delivering the intent. |
| 36 DataType data_type; |
| 37 |
27 WebIntentData(); | 38 WebIntentData(); |
28 WebIntentData(const WebKit::WebIntent& intent); | 39 WebIntentData(const WebKit::WebIntent& intent); |
| 40 WebIntentData(const string16& action_in, |
| 41 const string16& type_in, |
| 42 const string16& unserialized_data_in); |
29 ~WebIntentData(); | 43 ~WebIntentData(); |
30 }; | 44 }; |
31 | 45 |
32 } // namespace webkit_glue | 46 } // namespace webkit_glue |
33 | 47 |
34 #endif // WEBKIT_GLUE_WEB_INTENT_DATA_H_ | 48 #endif // WEBKIT_GLUE_WEB_INTENT_DATA_H_ |
OLD | NEW |