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

Unified Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 208313009: Fix the HTML5 drag and drop demos on Linux and CrOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: content/browser/web_contents/web_contents_view_aura.cc
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index db7b056258fd12016931be08ab10bd15306b8836..4e16de2ad476f16a11f261fe9df5f6d84100a4df 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -373,6 +373,10 @@ void PrepareDragData(const DropData& drop_data,
if (!drop_data.file_contents.empty())
PrepareDragForFileContents(drop_data, provider);
#endif
+ // Call SetString() before SetURL() when we actually have a custom string.
+ // SetURL() will itself do SetString() when a string hasn't been set yet,
+ // but we want to prefer drop_data.text.string() over the URL string if it
+ // exists.
if (!drop_data.text.string().empty())
provider->SetString(drop_data.text.string());
if (drop_data.url.is_valid())

Powered by Google App Engine
This is Rietveld 408576698