Commit 35b04f21 authored by Henrique Ferreiro's avatar Henrique Ferreiro Committed by Commit Bot

Fix dragging of images out of the browser

When porting StartDragging to Mojo in https://crrev.com/c/2320268, the
image contents weren't being set in the drop data. This resulted in a
link being saved on Windows and an error shown on Linux.

Bug: 1039255, 1132953
Change-Id: I2d21e0424c89306d5df8caf940e93999d16f78f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2444996Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Cr-Commit-Position: refs/heads/master@{#813645}
parent ba4e06a4
......@@ -147,7 +147,8 @@ DropData DragDataToDropData(const blink::mojom::DragData& drag_data) {
DCHECK(result.file_contents.empty());
const blink::mojom::DragItemBinaryPtr& binary_item = item->get_binary();
result.file_contents.reserve(binary_item->data.size());
std::vector<uint8_t> contents = binary_item->data;
result.file_contents.assign(contents.begin(), contents.end());
result.file_contents_source_url = binary_item->source_url;
result.file_contents_filename_extension =
binary_item->filename_extension.value();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment