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

Unified Diff: chrome/browser/download/download_target_determiner.cc

Issue 12662032: Merge SavePackageFilePicker{,ChromeOS} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r198452 Created 7 years, 7 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 f077cae959b53d955f24572367416098d83e08c6..ec47dea0ef8677dac27e48fa896a3c10f853251a 100644
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -59,7 +59,6 @@ DownloadTargetDeterminerDelegate::~DownloadTargetDeterminerDelegate() {
DownloadTargetDeterminer::DownloadTargetDeterminer(
DownloadItem* download,
DownloadPrefs* download_prefs,
- const base::FilePath& last_selected_directory,
DownloadTargetDeterminerDelegate* delegate,
const content::DownloadTargetCallback& callback)
: next_state_(STATE_GENERATE_TARGET_PATH),
@@ -72,7 +71,6 @@ DownloadTargetDeterminer::DownloadTargetDeterminer(
download_(download),
download_prefs_(download_prefs),
delegate_(delegate),
- last_selected_directory_(last_selected_directory),
completion_callback_(callback),
weak_ptr_factory_(this) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -159,11 +157,10 @@ DownloadTargetDeterminer::Result
default_filename);
should_prompt_ = ShouldPromptForDownload(generated_filename);
base::FilePath target_directory;
- if (should_prompt_ && !last_selected_directory_.empty()) {
- DCHECK(!download_prefs_->IsDownloadPathManaged());
+ if (should_prompt_ && !download_prefs_->IsDownloadPathManaged()) {
asanka 2013/05/07 15:15:12 The DCHECK() was to assert that we don't try to pr
benjhayden 2013/05/17 20:31:54 Done.
// If the user is going to be prompted and the user has been prompted
// before, then always prefer the last directory that the user selected.
- target_directory = last_selected_directory_;
+ target_directory = download_prefs_->SaveFilePath();
} else {
target_directory = download_prefs_->DownloadPath();
}
@@ -585,12 +582,10 @@ void DownloadTargetDeterminer::OnDownloadDestroyed(
void DownloadTargetDeterminer::Start(
content::DownloadItem* download,
DownloadPrefs* download_prefs,
- const base::FilePath& last_selected_directory,
DownloadTargetDeterminerDelegate* delegate,
const content::DownloadTargetCallback& callback) {
// DownloadTargetDeterminer owns itself and will self destruct when the job is
// complete or the download item is destroyed. The callback is always invoked
// asynchronously.
- new DownloadTargetDeterminer(download, download_prefs,
- last_selected_directory, delegate, callback);
+ new DownloadTargetDeterminer(download, download_prefs, delegate, callback);
}

Powered by Google App Engine
This is Rietveld 408576698