Chromium Code Reviews| Index: webkit/glue/webdropdata.cc |
| diff --git a/webkit/glue/webdropdata.cc b/webkit/glue/webdropdata.cc |
| index 0a06ac31be90f2a2c5bd9461f0dba5843531e328..7e2c2946a8ec45a34e2cb1477196ad62bdf3b224 100644 |
| --- a/webkit/glue/webdropdata.cc |
| +++ b/webkit/glue/webdropdata.cc |
| @@ -4,6 +4,8 @@ |
| #include "webkit/glue/webdropdata.h" |
| +#include <utility> |
| + |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
| @@ -33,6 +35,10 @@ WebDropData::WebDropData(const WebDragData& drag_data) |
| WebData contents = drag_data.fileContent(); |
| if (!contents.isEmpty()) |
| file_contents.assign(contents.data(), contents.size()); |
| + WebVector<WebDragData::CustomData> custom_data_copy = drag_data.customData(); |
| + for (size_t i = 0; i < custom_data_copy.size(); ++i) |
|
tony
2011/12/02 00:13:29
Nit: The for loop should use {} since the body is
dcheng
2011/12/02 00:29:17
Done.
|
| + custom_data.insert(std::make_pair(custom_data_copy[i].m_type, |
| + custom_data_copy[i].m_data)); |
| } |
| WebDropData::WebDropData() { |
| @@ -53,5 +59,13 @@ WebDragData WebDropData::ToDragData() const { |
| result.setHTMLBaseURL(html_base_url); |
| result.setFileContentFilename(file_description_filename); |
| result.setFileContent(WebData(file_contents.data(), file_contents.size())); |
| + WebVector<WebDragData::CustomData> custom_data_vector(custom_data.size()); |
| + size_t i = 0; |
| + for (std::map<string16, string16>::const_iterator it = custom_data.begin(); |
| + it != custom_data.end(); |
| + ++it) { |
| + WebDragData::CustomData data = {it->first, it->second}; |
| + custom_data_vector[i++] = data; |
|
tony
2011/12/02 00:13:29
Nit: I think it's a bit easier to read with i as p
dcheng
2011/12/02 00:29:17
Done.
|
| + } |
| return result; |
| } |