| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 if (!file_manager_) { | 245 if (!file_manager_) { |
| 246 NOTREACHED(); | 246 NOTREACHED(); |
| 247 return false; | 247 return false; |
| 248 } | 248 } |
| 249 | 249 |
| 250 // Create the fake DownloadItem and display the view. | 250 // Create the fake DownloadItem and display the view. |
| 251 download_ = new DownloadItem(1, saved_main_file_path_, 0, page_url_, | 251 download_ = new DownloadItem(1, saved_main_file_path_, 0, page_url_, |
| 252 FilePath(), Time::Now(), 0, -1, -1, false); | 252 FilePath(), Time::Now(), 0, -1, -1, false); |
| 253 download_->set_manager(tab_contents_->profile()->GetDownloadManager()); | 253 download_->set_manager(tab_contents_->profile()->GetDownloadManager()); |
| 254 #if !defined(OS_MACOSX) | 254 #if !defined(OS_MACOSX) |
| 255 DownloadShelf* shelf = tab_contents_->GetDownloadShelf(true); | 255 tab_contents_->OnStartDownload(download_); |
| 256 shelf->AddDownload(new SavePageModel(this, download_)); | |
| 257 tab_contents_->SetDownloadShelfVisible(true); | |
| 258 #else | 256 #else |
| 259 // TODO(port): Create a download shelf for mac. | 257 // TODO(port): Create a download shelf for mac. |
| 260 NOTIMPLEMENTED(); | 258 NOTIMPLEMENTED(); |
| 261 #endif | 259 #endif |
| 262 | 260 |
| 263 // Check save type and process the save page job. | 261 // Check save type and process the save page job. |
| 264 if (save_type_ == SAVE_AS_COMPLETE_HTML) { | 262 if (save_type_ == SAVE_AS_COMPLETE_HTML) { |
| 265 // Get directory | 263 // Get directory |
| 266 DCHECK(!saved_main_directory_path_.empty()); | 264 DCHECK(!saved_main_directory_path_.empty()); |
| 267 GetAllSavableResourceLinksForCurrentPage(); | 265 GetAllSavableResourceLinksForCurrentPage(); |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1160 int index, void* params) { | 1158 int index, void* params) { |
| 1161 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); | 1159 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); |
| 1162 ContinueSave(save_params, path, index); | 1160 ContinueSave(save_params, path, index); |
| 1163 delete save_params; | 1161 delete save_params; |
| 1164 } | 1162 } |
| 1165 | 1163 |
| 1166 void SavePackage::FileSelectionCanceled(void* params) { | 1164 void SavePackage::FileSelectionCanceled(void* params) { |
| 1167 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); | 1165 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); |
| 1168 delete save_params; | 1166 delete save_params; |
| 1169 } | 1167 } |
| OLD | NEW |