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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 } | 428 } |
429 | 429 |
430 void ChromeDownloadManagerDelegate::ChooseSavePath( | 430 void ChromeDownloadManagerDelegate::ChooseSavePath( |
431 WebContents* web_contents, | 431 WebContents* web_contents, |
432 const base::FilePath& suggested_path, | 432 const base::FilePath& suggested_path, |
433 const base::FilePath::StringType& default_extension, | 433 const base::FilePath::StringType& default_extension, |
434 bool can_save_as_complete, | 434 bool can_save_as_complete, |
435 const content::SavePackagePathPickedCallback& callback) { | 435 const content::SavePackagePathPickedCallback& callback) { |
436 // Deletes itself. | 436 // Deletes itself. |
437 #if defined(OS_CHROMEOS) | 437 #if defined(OS_CHROMEOS) |
438 new SavePackageFilePickerChromeOS(web_contents, suggested_path, callback); | 438 new SavePackageFilePickerChromeOS( |
| 439 web_contents, |
| 440 suggested_path, |
| 441 can_save_as_complete, |
| 442 callback); |
439 #else | 443 #else |
440 new SavePackageFilePicker(web_contents, suggested_path, default_extension, | 444 new SavePackageFilePicker( |
441 can_save_as_complete, download_prefs_.get(), callback); | 445 web_contents, |
| 446 suggested_path, |
| 447 default_extension, |
| 448 can_save_as_complete, |
| 449 download_prefs_.get(), |
| 450 callback); |
442 #endif | 451 #endif |
443 } | 452 } |
444 | 453 |
445 void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { | 454 void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { |
446 platform_util::OpenItem(GetPlatformDownloadPath(profile_, download)); | 455 platform_util::OpenItem(GetPlatformDownloadPath(profile_, download)); |
447 } | 456 } |
448 | 457 |
449 void ChromeDownloadManagerDelegate::ShowDownloadInShell( | 458 void ChromeDownloadManagerDelegate::ShowDownloadInShell( |
450 DownloadItem* download) { | 459 DownloadItem* download) { |
451 platform_util::ShowItemInFolder(GetPlatformDownloadPath(profile_, download)); | 460 platform_util::ShowItemInFolder(GetPlatformDownloadPath(profile_, download)); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 // TODO(asanka): This logic is a hack. DownloadFilePicker should give us a | 821 // TODO(asanka): This logic is a hack. DownloadFilePicker should give us a |
813 // directory to persist. Or perhaps, if the Drive path | 822 // directory to persist. Or perhaps, if the Drive path |
814 // substitution logic is moved here, then we would have a | 823 // substitution logic is moved here, then we would have a |
815 // persistable path after the DownloadFilePicker is done. | 824 // persistable path after the DownloadFilePicker is done. |
816 if (disposition == DownloadItem::TARGET_DISPOSITION_PROMPT && | 825 if (disposition == DownloadItem::TARGET_DISPOSITION_PROMPT && |
817 !download->IsTemporary()) | 826 !download->IsTemporary()) |
818 last_download_path_ = target_path.DirName(); | 827 last_download_path_ = target_path.DirName(); |
819 } | 828 } |
820 callback.Run(target_path, disposition, danger_type, intermediate_path); | 829 callback.Run(target_path, disposition, danger_type, intermediate_path); |
821 } | 830 } |
OLD | NEW |