Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1461)

Unified Diff: content/renderer/drop_data_builder.cc

Issue 1723763002: Add WebDragData to blink::WebView::dragtargetDrop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/drop_data.cc ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « content/public/common/drop_data.cc ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698