| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "chrome/browser/download/save_package.h" | 5 #include "chrome/browser/download/save_package.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 } | 250 } |
| 251 | 251 |
| 252 file_manager_ = rdh->save_file_manager(); | 252 file_manager_ = rdh->save_file_manager(); |
| 253 if (!file_manager_) { | 253 if (!file_manager_) { |
| 254 NOTREACHED(); | 254 NOTREACHED(); |
| 255 return false; | 255 return false; |
| 256 } | 256 } |
| 257 | 257 |
| 258 // Create the fake DownloadItem and display the view. | 258 // Create the fake DownloadItem and display the view. |
| 259 download_ = new DownloadItem(1, saved_main_file_path_, 0, page_url_, | 259 download_ = new DownloadItem(1, saved_main_file_path_, 0, page_url_, |
| 260 FilePath(), Time::Now(), 0, -1, -1, false); | 260 "", FilePath(), Time::Now(), 0, -1, -1, false); |
| 261 download_->set_manager(tab_contents_->profile()->GetDownloadManager()); | 261 download_->set_manager(tab_contents_->profile()->GetDownloadManager()); |
| 262 tab_contents_->OnStartDownload(download_); | 262 tab_contents_->OnStartDownload(download_); |
| 263 | 263 |
| 264 // Check save type and process the save page job. | 264 // Check save type and process the save page job. |
| 265 if (save_type_ == SAVE_AS_COMPLETE_HTML) { | 265 if (save_type_ == SAVE_AS_COMPLETE_HTML) { |
| 266 // Get directory | 266 // Get directory |
| 267 DCHECK(!saved_main_directory_path_.empty()); | 267 DCHECK(!saved_main_directory_path_.empty()); |
| 268 GetAllSavableResourceLinksForCurrentPage(); | 268 GetAllSavableResourceLinksForCurrentPage(); |
| 269 } else { | 269 } else { |
| 270 wait_state_ = NET_FILES; | 270 wait_state_ = NET_FILES; |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 int index, void* params) { | 1193 int index, void* params) { |
| 1194 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); | 1194 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); |
| 1195 ContinueSave(save_params, path, index); | 1195 ContinueSave(save_params, path, index); |
| 1196 delete save_params; | 1196 delete save_params; |
| 1197 } | 1197 } |
| 1198 | 1198 |
| 1199 void SavePackage::FileSelectionCanceled(void* params) { | 1199 void SavePackage::FileSelectionCanceled(void* params) { |
| 1200 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); | 1200 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); |
| 1201 delete save_params; | 1201 delete save_params; |
| 1202 } | 1202 } |
| OLD | NEW |