summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webdropdata.cc
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-18 22:05:16 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-18 22:05:16 +0000
commit909a7ba2db3646fcda94f33fff84cbc156d8c7e6 (patch)
treef96b1ffbaaf0c7465e9ee9b74ec9d07881b0a919 /webkit/glue/webdropdata.cc
parent9d6de472591113aade547801a38046f71144db32 (diff)
downloadchromium_src-909a7ba2db3646fcda94f33fff84cbc156d8c7e6.zip
chromium_src-909a7ba2db3646fcda94f33fff84cbc156d8c7e6.tar.gz
chromium_src-909a7ba2db3646fcda94f33fff84cbc156d8c7e6.tar.bz2
Support custom MIME type data in web drag/drop for Mac and GTK.
BUG=31037 TEST=manual Review URL: http://codereview.chromium.org/8833005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114947 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webdropdata.cc')
-rw-r--r--webkit/glue/webdropdata.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/webkit/glue/webdropdata.cc b/webkit/glue/webdropdata.cc
index be45487..1c4fea2 100644
--- a/webkit/glue/webdropdata.cc
+++ b/webkit/glue/webdropdata.cc
@@ -35,10 +35,11 @@ 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) {
- custom_data.insert(std::make_pair(custom_data_copy[i].type,
- custom_data_copy[i].data));
+ const WebVector<WebDragData::CustomData>& custom_data_alias =
+ drag_data.customData();
+ for (size_t i = 0; i < custom_data_alias.size(); ++i) {
+ custom_data.insert(std::make_pair(custom_data_alias[i].type,
+ custom_data_alias[i].data));
}
}
@@ -68,5 +69,6 @@ WebDragData WebDropData::ToDragData() const {
WebDragData::CustomData data = {it->first, it->second};
custom_data_vector[i] = data;
}
+ result.setCustomData(custom_data_vector);
return result;
}