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