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

Side by Side Diff: content/browser/download/download_manager_impl.cc

Issue 10905284: Use the user's preferred downloads directory for creating the initial download file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows path check Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/download/download_manager_impl.h" 5 #include "content/browser/download/download_manager_impl.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 366 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
367 367
368 // |bound_net_log| will be used for logging both the download item's and 368 // |bound_net_log| will be used for logging both the download item's and
369 // the download file's events. 369 // the download file's events.
370 net::BoundNetLog bound_net_log = CreateDownloadItem(info.get()); 370 net::BoundNetLog bound_net_log = CreateDownloadItem(info.get());
371 371
372 // If info->download_id was unknown on entry to this function, it was 372 // If info->download_id was unknown on entry to this function, it was
373 // assigned in CreateDownloadItem. 373 // assigned in CreateDownloadItem.
374 DownloadId download_id = info->download_id; 374 DownloadId download_id = info->download_id;
375 375
376 if (delegate_) {
377 FilePath website_save_directory; // Unused
378 bool skip_dir_check = false; // Unused
379 delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory,
380 &info->default_download_directory, &skip_dir_check);
381 }
382
376 DownloadFileManager::CreateDownloadFileCallback callback( 383 DownloadFileManager::CreateDownloadFileCallback callback(
377 base::Bind(&DownloadManagerImpl::OnDownloadFileCreated, 384 base::Bind(&DownloadManagerImpl::OnDownloadFileCreated,
378 this, download_id.local())); 385 this, download_id.local()));
379 386
380 BrowserThread::PostTask( 387 BrowserThread::PostTask(
381 BrowserThread::FILE, FROM_HERE, 388 BrowserThread::FILE, FROM_HERE,
382 base::Bind(&DownloadFileManager::CreateDownloadFile, 389 base::Bind(&DownloadFileManager::CreateDownloadFile,
383 file_manager_, base::Passed(info.Pass()), 390 file_manager_, base::Passed(info.Pass()),
384 base::Passed(stream.Pass()), make_scoped_refptr(this), 391 base::Passed(stream.Pass()), make_scoped_refptr(this),
385 (delegate_ && delegate_->GenerateFileHash()), bound_net_log, 392 (delegate_ && delegate_->GenerateFileHash()), bound_net_log,
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 void DownloadManagerImpl::DownloadRenamedToFinalName( 1067 void DownloadManagerImpl::DownloadRenamedToFinalName(
1061 DownloadItemImpl* download) { 1068 DownloadItemImpl* download) {
1062 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1069 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1063 // If the rename failed, we receive an OnDownloadInterrupted() call before we 1070 // If the rename failed, we receive an OnDownloadInterrupted() call before we
1064 // receive the DownloadRenamedToFinalName() call. 1071 // receive the DownloadRenamedToFinalName() call.
1065 if (delegate_) { 1072 if (delegate_) {
1066 delegate_->UpdatePathForItemInPersistentStore( 1073 delegate_->UpdatePathForItemInPersistentStore(
1067 download, download->GetFullPath()); 1074 download, download->GetFullPath());
1068 } 1075 }
1069 } 1076 }
OLDNEW
« no previous file with comments | « content/browser/download/download_file_impl.cc ('k') | content/browser/download/download_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698