| 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 "chrome/browser/download/chrome_download_manager_delegate.h" | 5 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 } | 348 } |
| 349 | 349 |
| 350 void ChromeDownloadManagerDelegate::ChooseSavePath( | 350 void ChromeDownloadManagerDelegate::ChooseSavePath( |
| 351 WebContents* web_contents, | 351 WebContents* web_contents, |
| 352 const FilePath& suggested_path, | 352 const FilePath& suggested_path, |
| 353 const FilePath::StringType& default_extension, | 353 const FilePath::StringType& default_extension, |
| 354 bool can_save_as_complete, | 354 bool can_save_as_complete, |
| 355 content::SaveFilePathPickedCallback callback) { | 355 content::SaveFilePathPickedCallback callback) { |
| 356 // Deletes itself. | 356 // Deletes itself. |
| 357 #if defined(OS_CHROMEOS) | 357 #if defined(OS_CHROMEOS) |
| 358 // Note that we're ignoring the callback here. | 358 new SavePackageFilePickerChromeOS(web_contents, suggested_path, callback); |
| 359 // SavePackageFilePickerChromeOS completes the save operation itself. | |
| 360 // TODO(achuith): Fix this. | |
| 361 new SavePackageFilePickerChromeOS(web_contents, suggested_path); | |
| 362 #else | 359 #else |
| 363 new SavePackageFilePicker(web_contents, suggested_path, default_extension, | 360 new SavePackageFilePicker(web_contents, suggested_path, default_extension, |
| 364 can_save_as_complete, download_prefs_.get(), callback); | 361 can_save_as_complete, download_prefs_.get(), callback); |
| 365 #endif | 362 #endif |
| 366 } | 363 } |
| 367 | 364 |
| 368 #if defined(ENABLE_SAFE_BROWSING) | 365 #if defined(ENABLE_SAFE_BROWSING) |
| 369 DownloadProtectionService* | 366 DownloadProtectionService* |
| 370 ChromeDownloadManagerDelegate::GetDownloadProtectionService() { | 367 ChromeDownloadManagerDelegate::GetDownloadProtectionService() { |
| 371 SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); | 368 SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 int32 download_id, int64 db_handle) { | 674 int32 download_id, int64 db_handle) { |
| 678 // It's not immediately obvious, but HistoryBackend::CreateDownload() can | 675 // It's not immediately obvious, but HistoryBackend::CreateDownload() can |
| 679 // call this function with an invalid |db_handle|. For instance, this can | 676 // call this function with an invalid |db_handle|. For instance, this can |
| 680 // happen when the history database is offline. We cannot have multiple | 677 // happen when the history database is offline. We cannot have multiple |
| 681 // DownloadItems with the same invalid db_handle, so we need to assign a | 678 // DownloadItems with the same invalid db_handle, so we need to assign a |
| 682 // unique |db_handle| here. | 679 // unique |db_handle| here. |
| 683 if (db_handle == DownloadItem::kUninitializedHandle) | 680 if (db_handle == DownloadItem::kUninitializedHandle) |
| 684 db_handle = download_history_->GetNextFakeDbHandle(); | 681 db_handle = download_history_->GetNextFakeDbHandle(); |
| 685 download_manager_->OnItemAddedToPersistentStore(download_id, db_handle); | 682 download_manager_->OnItemAddedToPersistentStore(download_id, db_handle); |
| 686 } | 683 } |
| OLD | NEW |