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

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: Adding tests. 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
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..44d05aee03707f4da9c1aeb8070a55f94f56c45f 100644
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -194,13 +194,20 @@ 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 (suggested_filename.empty() &&
+ download_->GetMimeType() == "application/x-x509-user-cert") {
+ 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);

Powered by Google App Engine
This is Rietveld 408576698