| Index: content/renderer/render_view_impl.cc
|
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
| index bb6f263617d079a0700b50749263c169b07715f4..e1bcaa9ea69f2827e8fdb22cd3dfc7ca277f230d 100644
|
| --- a/content/renderer/render_view_impl.cc
|
| +++ b/content/renderer/render_view_impl.cc
|
| @@ -426,6 +426,37 @@ class WebWidgetLockTarget : public MouseLockDispatcher::LockTarget {
|
| blink::WebWidget* webwidget_;
|
| };
|
|
|
| +WebDragData DropMetaDataToWebDragData(
|
| + const std::vector<MimeTypeKindPair> drop_meta_data) {
|
| + std::vector<WebDragData::Item> item_list;
|
| + for (MimeTypeKindPair pair : drop_meta_data) {
|
| + if (pair.second == base::ASCIIToUTF16("string")) {
|
| + WebDragData::Item item;
|
| + item.storageType = WebDragData::Item::StorageTypeString;
|
| + item.stringType = pair.first;
|
| + continue;
|
| + }
|
| +
|
| + if (pair.second == base::ASCIIToUTF16("filename")) {
|
| + WebDragData::Item item;
|
| + item.storageType = WebDragData::Item::StorageTypeFilename;
|
| + continue;
|
| + }
|
| +
|
| + if (pair.second == base::ASCIIToUTF16("filesystemfile")) {
|
| + WebDragData::Item item;
|
| + item.storageType = WebDragData::Item::StorageTypeFileSystemFile;
|
| +
|
| + continue;
|
| + }
|
| + }
|
| +
|
| + WebDragData result;
|
| + result.initialize();
|
| + result.setItems(item_list);
|
| + return result;
|
| +}
|
| +
|
| WebDragData DropDataToWebDragData(const DropData& drop_data) {
|
| std::vector<WebDragData::Item> item_list;
|
|
|
| @@ -2336,17 +2367,15 @@ void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) {
|
| main_render_frame_->MaybeEnableMojoBindings();
|
| }
|
|
|
| -void RenderViewImpl::OnDragTargetDragEnter(const DropData& drop_data,
|
| - const gfx::Point& client_point,
|
| - const gfx::Point& screen_point,
|
| - WebDragOperationsMask ops,
|
| - int key_modifiers) {
|
| +void RenderViewImpl::OnDragTargetDragEnter(
|
| + const std::vector<MimeTypeKindPair> drop_meta_data,
|
| + const gfx::Point& client_point,
|
| + const gfx::Point& screen_point,
|
| + WebDragOperationsMask ops,
|
| + int key_modifiers) {
|
| WebDragOperation operation = webview()->dragTargetDragEnter(
|
| - DropDataToWebDragData(drop_data),
|
| - ConvertWindowPointToViewport(client_point),
|
| - screen_point,
|
| - ops,
|
| - key_modifiers);
|
| + DropMetaDataToWebDragData(drop_meta_data), client_point, screen_point,
|
| + ops, key_modifiers);
|
|
|
| Send(new DragHostMsg_UpdateDragCursor(GetRoutingID(), operation));
|
| }
|
| @@ -2368,11 +2397,12 @@ void RenderViewImpl::OnDragTargetDragLeave() {
|
| webview()->dragTargetDragLeave();
|
| }
|
|
|
| -void RenderViewImpl::OnDragTargetDrop(const gfx::Point& client_point,
|
| +void RenderViewImpl::OnDragTargetDrop(const DropData& drop_data,
|
| + const gfx::Point& client_point,
|
| const gfx::Point& screen_point,
|
| int key_modifiers) {
|
| - webview()->dragTargetDrop(
|
| - ConvertWindowPointToViewport(client_point), screen_point, key_modifiers);
|
| + webview()->dragTargetDrop(DropDataToWebDragData(drop_data), client_point,
|
| + screen_point, key_modifiers);
|
| }
|
|
|
| void RenderViewImpl::OnDragSourceEnded(const gfx::Point& client_point,
|
|
|