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

Unified Diff: chrome/browser/download/download_target_determiner.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: 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 99bcd7f1e855e09c96b958c6277aeda025c8f3dd..17bb22dc1343abd0c10acdb89104b50eb8c58335 100644
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -95,6 +95,7 @@ DownloadTargetDeterminer::DownloadTargetDeterminer(
is_dangerous_file_(false),
virtual_path_(initial_virtual_path),
is_filetype_handled_safely_(false),
+ hide_file_extension_(false),
download_(download),
is_resumption_(download_->GetLastReason() !=
content::DOWNLOAD_INTERRUPT_REASON_NONE &&
@@ -335,7 +336,7 @@ DownloadTargetDeterminer::Result
}
void DownloadTargetDeterminer::PromptUserForDownloadPathDone(
- const base::FilePath& virtual_path) {
+ const base::FilePath& virtual_path, bool hide_file_extension) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "User selected path:" << virtual_path.AsUTF8Unsafe();
if (virtual_path.empty()) {
@@ -346,6 +347,7 @@ void DownloadTargetDeterminer::PromptUserForDownloadPathDone(
virtual_path_ = virtual_path;
download_prefs_->SetSaveFilePath(virtual_path_.DirName());
+ hide_file_extension_ = hide_file_extension;
DoLoop();
}
@@ -735,6 +737,7 @@ void DownloadTargetDeterminer::ScheduleCallbackAndDeleteSelf() {
target_info->intermediate_path = intermediate_path_;
target_info->mime_type = mime_type_;
target_info->is_filetype_handled_safely = is_filetype_handled_safely_;
+ target_info->hide_file_extension = hide_file_extension_;
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(completion_callback_, base::Passed(&target_info)));
« no previous file with comments | « chrome/browser/download/download_target_determiner.h ('k') | chrome/browser/download/download_target_determiner_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698