Chromium Code Reviews| 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); |