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

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 10802056: Switch default filename retrieval to use GetFielNameToReportUser, which is more authoritative. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get rid of GetSuggestedFilename Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/chrome_download_manager_delegate.cc
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 644b3d914078f04b1fc752be099ee15801cb8a54..2e5ae5e9b589185140c6f880f34fb2845d866991 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -399,13 +399,10 @@ void ChromeDownloadManagerDelegate::OpenWithWebIntent(
intent_data.extra_data.insert(make_pair(
ASCIIToUTF16("url"), ASCIIToUTF16(item->GetURL().spec())));
- // The SuggestedFilename is not always filled in in the DownloadItem.
- // When it is, it comes from the purpose-built HTML algorithm, but
- // in practice it is frequently just inferred.
- string16 filename = UTF8ToUTF16(item->GetSuggestedFilename());
- if (filename.empty())
- filename = item->GetFileNameToReportUser().LossyDisplayName();
- intent_data.extra_data.insert(make_pair(ASCIIToUTF16("filename"), filename));
+ // Pass the downloaded filename to the service app as the name hint.
+ intent_data.extra_data.insert(
+ make_pair(ASCIIToUTF16("filename"),
+ item->GetFileNameToReportUser().LossyDisplayName()));
content::WebIntentsDispatcher* dispatcher =
content::WebIntentsDispatcher::Create(intent_data);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698