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

Unified Diff: content/browser/download/download_item_impl.cc

Issue 1513413002: Enable "Hide Extension" option when "Save Link As" on the Mac Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits. Created 5 years 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: 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());
« no previous file with comments | « content/browser/download/download_item_impl.h ('k') | content/browser/download/download_item_impl_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698