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" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel
.h" |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 for (size_t i = 0; i < names.size(); ++i) { | 35 for (size_t i = 0; i < names.size(); ++i) { |
36 extra_data[names[i]] = intent.extrasValue(names[i]); | 36 extra_data[names[i]] = intent.extrasValue(names[i]); |
37 } | 37 } |
38 | 38 |
39 const WebVector<WebURL>& clientSuggestions = intent.suggestions(); | 39 const WebVector<WebURL>& clientSuggestions = intent.suggestions(); |
40 for (size_t i = 0; i < clientSuggestions.size(); ++i) | 40 for (size_t i = 0; i < clientSuggestions.size(); ++i) |
41 suggestions.push_back(clientSuggestions[i]); | 41 suggestions.push_back(clientSuggestions[i]); |
42 } | 42 } |
43 | 43 |
44 WebIntentData::WebIntentData(const string16& action_in, | 44 WebIntentData::WebIntentData(const string16& action_in, |
| 45 const string16& type_in) |
| 46 : action(action_in), |
| 47 type(type_in), |
| 48 blob_length(0), |
| 49 data_type(MIME_TYPE) { |
| 50 } |
| 51 |
| 52 WebIntentData::WebIntentData(const string16& action_in, |
45 const string16& type_in, | 53 const string16& type_in, |
46 const string16& unserialized_data_in) | 54 const string16& unserialized_data_in) |
47 : action(action_in), | 55 : action(action_in), |
48 type(type_in), | 56 type(type_in), |
49 unserialized_data(unserialized_data_in), | 57 unserialized_data(unserialized_data_in), |
50 blob_length(0), | 58 blob_length(0), |
51 data_type(UNSERIALIZED) { | 59 data_type(UNSERIALIZED) { |
52 } | 60 } |
53 | 61 |
54 WebIntentData::WebIntentData(const string16& action_in, | 62 WebIntentData::WebIntentData(const string16& action_in, |
(...skipping 12 matching lines...) Expand all Loading... |
67 const std::string& root_name_in, | 75 const std::string& root_name_in, |
68 const std::string& filesystem_id_in) | 76 const std::string& filesystem_id_in) |
69 : action(action_in), | 77 : action(action_in), |
70 type(type_in), | 78 type(type_in), |
71 blob_length(0), | 79 blob_length(0), |
72 root_name(root_name_in), | 80 root_name(root_name_in), |
73 filesystem_id(filesystem_id_in), | 81 filesystem_id(filesystem_id_in), |
74 data_type(FILESYSTEM) { | 82 data_type(FILESYSTEM) { |
75 } | 83 } |
76 | 84 |
| 85 WebIntentData::WebIntentData(const WebIntentData& intent_data) |
| 86 : action(intent_data.action), |
| 87 type(intent_data.type), |
| 88 data(intent_data.data), |
| 89 extra_data(intent_data.extra_data), |
| 90 service(intent_data.service), |
| 91 suggestions(intent_data.suggestions), |
| 92 unserialized_data(intent_data.unserialized_data), |
| 93 message_port_ids(intent_data.message_port_ids), |
| 94 blob_file(intent_data.blob_file), |
| 95 blob_length(intent_data.blob_length), |
| 96 root_name(intent_data.root_name), |
| 97 filesystem_id(intent_data.filesystem_id), |
| 98 data_type(intent_data.data_type) { |
| 99 for (size_t i = 0; i < intent_data.mime_data.GetSize(); ++i) { |
| 100 const DictionaryValue* dict = NULL; |
| 101 if (!intent_data.mime_data.GetDictionary(i, &dict)) continue; |
| 102 mime_data.Append(dict->DeepCopy()); |
| 103 } |
| 104 } |
| 105 |
77 } // namespace webkit_glue | 106 } // namespace webkit_glue |
OLD | NEW |