Index: content/browser/download/download_item_impl.cc |
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc |
index 33de9d6cf705e44bffdbb9e0c1de9704be2a0bc9..80f939d49724249dccfb87e540c7c2b3014d18ad 100644 |
--- a/content/browser/download/download_item_impl.cc |
+++ b/content/browser/download/download_item_impl.cc |
@@ -1170,7 +1170,8 @@ void DownloadItemImpl::OnDownloadTargetDetermined( |
const base::FilePath& target_path, |
TargetDisposition disposition, |
DownloadDangerType danger_type, |
- const base::FilePath& intermediate_path) { |
+ const base::FilePath& intermediate_path, |
+ bool hide_file_extension) { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
// If the |target_path| is empty, then we consider this download to be |
@@ -1220,6 +1221,10 @@ void DownloadItemImpl::OnDownloadTargetDetermined( |
// http://crbug.com/74187. |
DCHECK(!is_save_package_download_); |
DCHECK(download_file_.get()); |
+ if (hide_file_extension) { |
+ download_file_.get()->SetHideFileExtension(true); |
+ SetDisplayName(target_path_.BaseName().RemoveExtension()); |
+ } |
DownloadFile::RenameCompletionCallback callback = |
base::Bind(&DownloadItemImpl::OnDownloadRenamedToIntermediateName, |
weak_ptr_factory_.GetWeakPtr()); |