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

Side by Side Diff: content/browser/download/save_package.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/save_package.h" 5 #include "content/browser/download/save_package.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 } 1236 }
1237 1237
1238 void SavePackage::GetSaveInfo() { 1238 void SavePackage::GetSaveInfo() {
1239 // Can't use web_contents_ in the file thread, so get the data that we need 1239 // Can't use web_contents_ in the file thread, so get the data that we need
1240 // before calling to it. 1240 // before calling to it.
1241 FilePath website_save_dir, download_save_dir; 1241 FilePath website_save_dir, download_save_dir;
1242 bool skip_dir_check; 1242 bool skip_dir_check;
1243 DCHECK(download_manager_); 1243 DCHECK(download_manager_);
1244 if (download_manager_->GetDelegate()) { 1244 if (download_manager_->GetDelegate()) {
1245 download_manager_->GetDelegate()->GetSaveDir( 1245 download_manager_->GetDelegate()->GetSaveDir(
1246 web_contents(), &website_save_dir, &download_save_dir, &skip_dir_check); 1246 web_contents()->GetBrowserContext(), &website_save_dir,
1247 &download_save_dir, &skip_dir_check);
1247 } 1248 }
1248 std::string mime_type = web_contents()->GetContentsMimeType(); 1249 std::string mime_type = web_contents()->GetContentsMimeType();
1249 std::string accept_languages = 1250 std::string accept_languages =
1250 content::GetContentClient()->browser()->GetAcceptLangs( 1251 content::GetContentClient()->browser()->GetAcceptLangs(
1251 web_contents()->GetBrowserContext()); 1252 web_contents()->GetBrowserContext());
1252 1253
1253 BrowserThread::PostTask( 1254 BrowserThread::PostTask(
1254 BrowserThread::FILE, FROM_HERE, 1255 BrowserThread::FILE, FROM_HERE,
1255 base::Bind(&SavePackage::CreateDirectoryOnFileThread, this, 1256 base::Bind(&SavePackage::CreateDirectoryOnFileThread, this,
1256 website_save_dir, download_save_dir, skip_dir_check, 1257 website_save_dir, download_save_dir, skip_dir_check,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 StopObservation(); 1362 StopObservation();
1362 } 1363 }
1363 1364
1364 void SavePackage::FinalizeDownloadEntry() { 1365 void SavePackage::FinalizeDownloadEntry() {
1365 DCHECK(download_); 1366 DCHECK(download_);
1366 DCHECK(download_manager_); 1367 DCHECK(download_manager_);
1367 1368
1368 download_manager_->SavePageDownloadFinished(download_); 1369 download_manager_->SavePageDownloadFinished(download_);
1369 StopObservation(); 1370 StopObservation();
1370 } 1371 }
OLDNEW
« no previous file with comments | « content/browser/download/save_file.cc ('k') | content/public/browser/download_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698