| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 | 1146 |
| 1147 void SavePackage::GetSaveInfo() { | 1147 void SavePackage::GetSaveInfo() { |
| 1148 // Can't use tab_contents_ in the file thread, so get the data that we need | 1148 // Can't use tab_contents_ in the file thread, so get the data that we need |
| 1149 // before calling to it. | 1149 // before calling to it. |
| 1150 FilePath website_save_dir, download_save_dir; | 1150 FilePath website_save_dir, download_save_dir; |
| 1151 DCHECK(download_manager_); | 1151 DCHECK(download_manager_); |
| 1152 download_manager_->delegate()->GetSaveDir( | 1152 download_manager_->delegate()->GetSaveDir( |
| 1153 tab_contents(), &website_save_dir, &download_save_dir); | 1153 tab_contents(), &website_save_dir, &download_save_dir); |
| 1154 std::string mime_type = tab_contents()->contents_mime_type(); | 1154 std::string mime_type = tab_contents()->contents_mime_type(); |
| 1155 std::string accept_languages = | 1155 std::string accept_languages = |
| 1156 content::GetContentClient()->browser()->GetAcceptLangs(tab_contents()); | 1156 content::GetContentClient()->browser()->GetAcceptLangs( |
| 1157 tab_contents()->browser_context()); |
| 1157 | 1158 |
| 1158 BrowserThread::PostTask( | 1159 BrowserThread::PostTask( |
| 1159 BrowserThread::FILE, FROM_HERE, | 1160 BrowserThread::FILE, FROM_HERE, |
| 1160 base::Bind(&SavePackage::CreateDirectoryOnFileThread, this, | 1161 base::Bind(&SavePackage::CreateDirectoryOnFileThread, this, |
| 1161 website_save_dir, download_save_dir, mime_type, accept_languages)); | 1162 website_save_dir, download_save_dir, mime_type, accept_languages)); |
| 1162 } | 1163 } |
| 1163 | 1164 |
| 1164 void SavePackage::CreateDirectoryOnFileThread( | 1165 void SavePackage::CreateDirectoryOnFileThread( |
| 1165 const FilePath& website_save_dir, | 1166 const FilePath& website_save_dir, |
| 1166 const FilePath& download_save_dir, | 1167 const FilePath& download_save_dir, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 StopObservation(); | 1280 StopObservation(); |
| 1280 } | 1281 } |
| 1281 | 1282 |
| 1282 void SavePackage::FinalizeDownloadEntry() { | 1283 void SavePackage::FinalizeDownloadEntry() { |
| 1283 DCHECK(download_); | 1284 DCHECK(download_); |
| 1284 DCHECK(download_manager_); | 1285 DCHECK(download_manager_); |
| 1285 | 1286 |
| 1286 download_manager_->SavePageDownloadFinished(download_); | 1287 download_manager_->SavePageDownloadFinished(download_); |
| 1287 StopObservation(); | 1288 StopObservation(); |
| 1288 } | 1289 } |
| OLD | NEW |