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

Unified Diff: ui/base/dragdrop/os_exchange_data_provider_win.cc

Issue 380553002: Add a unit test that filenames aren't unintentionally converted to URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows Created 6 years, 5 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: ui/base/dragdrop/os_exchange_data_provider_win.cc
diff --git a/ui/base/dragdrop/os_exchange_data_provider_win.cc b/ui/base/dragdrop/os_exchange_data_provider_win.cc
index 4cbfa4a8512d2904c6ae090db90bd1dfb4a2e9b0..729269c12ce6573c3d549614aaa712ecc78209ff 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_win.cc
+++ b/ui/base/dragdrop/os_exchange_data_provider_win.cc
@@ -411,15 +411,12 @@ bool OSExchangeDataProviderWin::GetURLAndTitle(
base::string16 url_str;
bool success = ClipboardUtil::GetUrl(
source_object_,
- &url_str,
+ url,
title,
policy == OSExchangeData::CONVERT_FILENAMES ? true : false);
if (success) {
- GURL test_url(url_str);
- if (test_url.is_valid()) {
- *url = test_url;
- return true;
- }
+ DCHECK(url->is_valid());
+ return true;
} else if (GetPlainTextURL(source_object_, url)) {
if (url->is_valid())
*title = net::GetSuggestedFilename(*url, "", "", "", "", std::string());

Powered by Google App Engine
This is Rietveld 408576698