Commit 425a4462 authored by Henrique Ferreiro's avatar Henrique Ferreiro Committed by Commit Bot

Only set DropData::referrer_policy for 'downloadurl' mime type

The referrer policy is only used when dragging a link out of the WebView
results in a download. This is handled on Windows when the mime type is
'downloadurl'. This CL avoids storing the policy unconditionally when
converting the DragData Mojo type to DropData.

Bug: 1039255
Change-Id: Id0b94a7bddb274b53aba2e5c163407f0c875d95c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391068Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Cr-Commit-Position: refs/heads/master@{#804573}
parent f443c012
...@@ -24,7 +24,6 @@ namespace content { ...@@ -24,7 +24,6 @@ namespace content {
// static // static
DropData DropDataBuilder::Build(const WebDragData& drag_data) { DropData DropDataBuilder::Build(const WebDragData& drag_data) {
DropData result; DropData result;
result.referrer_policy = drag_data.ReferrerPolicy();
for (const WebDragData::Item& item : drag_data.Items()) { for (const WebDragData::Item& item : drag_data.Items()) {
switch (item.storage_type) { switch (item.storage_type) {
...@@ -41,6 +40,7 @@ DropData DropDataBuilder::Build(const WebDragData& drag_data) { ...@@ -41,6 +40,7 @@ DropData DropDataBuilder::Build(const WebDragData& drag_data) {
} }
if (base::EqualsASCII(str_type, ui::kMimeTypeDownloadURL)) { if (base::EqualsASCII(str_type, ui::kMimeTypeDownloadURL)) {
result.download_metadata = item.string_data.Utf16(); result.download_metadata = item.string_data.Utf16();
result.referrer_policy = drag_data.ReferrerPolicy();
break; break;
} }
if (base::EqualsASCII(str_type, ui::kMimeTypeHTML)) { if (base::EqualsASCII(str_type, ui::kMimeTypeHTML)) {
......
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