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

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

Issue 1423663012: Removing x-x509-user-cert mime handler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving to chrome. Created 4 years, 11 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 | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | components/mime_util/mime_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_target_determiner.cc
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc
index 32d6563a2f596b1db57d844e3e41e954b53acc2f..5ff2edf1f913a849b890e3472c4003f4c58832e8 100644
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -194,13 +194,18 @@ DownloadTargetDeterminer::Result
// (WebStore, Drag&Drop). Treat the path as a virtual path. We will
// eventually determine whether this is a local path and if not, figure out
// a local path.
+
+ std::string suggested_filename = download_->GetSuggestedFilename();
+ if (download_->GetMimeType() == "application/x-x509-user-cert")
asanka 2016/01/11 21:52:42 How about conditionalizing this on suggested_filen
+ suggested_filename = "user.crt";
+
std::string default_filename(
l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
base::FilePath generated_filename = net::GenerateFileName(
download_->GetURL(),
download_->GetContentDisposition(),
GetProfile()->GetPrefs()->GetString(prefs::kDefaultCharset),
- download_->GetSuggestedFilename(),
+ suggested_filename,
download_->GetMimeType(),
default_filename);
should_prompt_ = ShouldPromptForDownload(generated_filename);
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | components/mime_util/mime_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698