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 #include "webkit/glue/web_intent_data.h" | 5 #include "webkit/glue/web_intent_data.h" |
6 | 6 |
7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntent.h" | 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntent.h" |
| 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel
.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
8 | 11 |
9 namespace webkit_glue { | 12 namespace webkit_glue { |
10 | 13 |
11 WebIntentData::WebIntentData() | 14 WebIntentData::WebIntentData() |
12 : blob_length(0), | 15 : blob_length(0), |
13 data_type(SERIALIZED) { | 16 data_type(SERIALIZED) { |
14 } | 17 } |
15 | 18 |
16 WebIntentData::~WebIntentData() { | 19 WebIntentData::~WebIntentData() { |
17 } | 20 } |
18 | 21 |
19 WebIntentData::WebIntentData(const WebKit::WebIntent& intent) | 22 WebIntentData::WebIntentData(const WebKit::WebIntent& intent) |
20 : action(intent.action()), | 23 : action(intent.action()), |
21 type(intent.type()), | 24 type(intent.type()), |
22 data(intent.data()), | 25 data(intent.data()), |
| 26 service(intent.service()), |
23 blob_length(0), | 27 blob_length(0), |
24 data_type(SERIALIZED) { | 28 data_type(SERIALIZED) { |
| 29 WebKit::WebVector<WebKit::WebString> names = intent.extrasNames(); |
| 30 for (size_t i = 0; i < names.size(); ++i) { |
| 31 extra_data[names[i]] = intent.extrasValue(names[i]); |
| 32 } |
25 } | 33 } |
26 | 34 |
27 WebIntentData::WebIntentData(const string16& action_in, | 35 WebIntentData::WebIntentData(const string16& action_in, |
28 const string16& type_in, | 36 const string16& type_in, |
29 const string16& unserialized_data_in) | 37 const string16& unserialized_data_in) |
30 : action(action_in), | 38 : action(action_in), |
31 type(type_in), | 39 type(type_in), |
32 unserialized_data(unserialized_data_in), | 40 unserialized_data(unserialized_data_in), |
33 blob_length(0), | 41 blob_length(0), |
34 data_type(UNSERIALIZED) { | 42 data_type(UNSERIALIZED) { |
35 } | 43 } |
36 | 44 |
37 WebIntentData::WebIntentData(const string16& action_in, | 45 WebIntentData::WebIntentData(const string16& action_in, |
38 const string16& type_in, | 46 const string16& type_in, |
39 const FilePath& blob_file_in, | 47 const FilePath& blob_file_in, |
40 int64 blob_length_in) | 48 int64 blob_length_in) |
41 : action(action_in), | 49 : action(action_in), |
42 type(type_in), | 50 type(type_in), |
43 blob_file(blob_file_in), | 51 blob_file(blob_file_in), |
44 blob_length(blob_length_in), | 52 blob_length(blob_length_in), |
45 data_type(BLOB) { | 53 data_type(BLOB) { |
46 } | 54 } |
47 | 55 |
48 } // namespace webkit_glue | 56 } // namespace webkit_glue |
OLD | NEW |