Chromium Code Reviews| Index: content/renderer/drop_data_builder.cc |
| diff --git a/content/renderer/drop_data_builder.cc b/content/renderer/drop_data_builder.cc |
| index e10d8d798788b9e2289cd674d95d38aa2e70eeb1..47f0c12b05b244ce2b9fc1f0da8cf8a398095ae5 100644 |
| --- a/content/renderer/drop_data_builder.cc |
| +++ b/content/renderer/drop_data_builder.cc |
| @@ -37,7 +37,15 @@ DropData DropDataBuilder::Build(const WebDragData& drag_data) { |
| break; |
| } |
| if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeURIList)) { |
| - result.url = blink::WebStringToGURL(item.stringData); |
| + // The url in WebDragData received could be empty at DragEnter time, |
|
dcheng
2016/06/15 12:00:39
Let's do this this when we convert DropData::Metad
hush (inactive)
2016/06/15 18:02:59
Done.
|
| + // because the URL is not available at DragEnter. We need to convert |
| + // to a dummy URL instead of an empty URL, because the latter means |
| + // "no URL is in DropData". |
| + if (item.stringData.isEmpty()) { |
| + result.url = GURL("about:dragdrop-placeholder"); |
| + } else { |
| + result.url = blink::WebStringToGURL(item.stringData); |
| + } |
| result.url_title = item.title; |
| break; |
| } |