| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |