Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Side by Side Diff: webkit/glue/web_intent_data.h

Issue 9651020: Pass content-type resources to web intents. Goes through download, then invokes the p… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move code embedder-side Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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;
28 // Any extra key-value pair metadata. (Not serialized.)
29 std::map<string16, string16> extra_data;
26 30
27 // String payload data. 31 // String payload data.
28 string16 unserialized_data; 32 string16 unserialized_data;
29 33
34 // The filename of a payload blob.
35 std::string blob_file;
36 // Length of the blob.
37 int64 blob_length;
38
30 // These enum values indicate which payload data type should be used. 39 // These enum values indicate which payload data type should be used.
31 enum DataType { 40 enum DataType {
32 SERIALIZED = 0, // The payload is serialized in |data|. 41 SERIALIZED = 0, // The payload is serialized in |data|.
33 UNSERIALIZED = 1 // The payload is unseriazed in |unserialized_data|. 42 UNSERIALIZED = 1, // The payload is unserialized in |unserialized_data|.
43 BLOB = 2 // The payload is a blob
34 }; 44 };
35 // Which data payload to use when delivering the intent. 45 // Which data payload to use when delivering the intent.
36 DataType data_type; 46 DataType data_type;
37 47
38 WebIntentData(); 48 WebIntentData();
39 WebIntentData(const WebKit::WebIntent& intent); 49 WebIntentData(const WebKit::WebIntent& intent);
40 WebIntentData(const string16& action_in, 50 WebIntentData(const string16& action_in,
41 const string16& type_in, 51 const string16& type_in,
42 const string16& unserialized_data_in); 52 const string16& unserialized_data_in);
53 WebIntentData(const string16& action_in,
54 const string16& type_in,
55 const std::string& blob_file_in,
56 int64 blob_length_in);
43 ~WebIntentData(); 57 ~WebIntentData();
44 }; 58 };
45 59
46 } // namespace webkit_glue 60 } // namespace webkit_glue
47 61
48 #endif // WEBKIT_GLUE_WEB_INTENT_DATA_H_ 62 #endif // WEBKIT_GLUE_WEB_INTENT_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698