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/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 can_save_as_complete, | 421 can_save_as_complete, |
422 download_prefs_.get(), | 422 download_prefs_.get(), |
423 callback); | 423 callback); |
424 } | 424 } |
425 | 425 |
426 void ChromeDownloadManagerDelegate::OpenDownloadUsingPlatformHandler( | 426 void ChromeDownloadManagerDelegate::OpenDownloadUsingPlatformHandler( |
427 DownloadItem* download) { | 427 DownloadItem* download) { |
428 base::FilePath platform_path( | 428 base::FilePath platform_path( |
429 GetPlatformDownloadPath(profile_, download, PLATFORM_TARGET_PATH)); | 429 GetPlatformDownloadPath(profile_, download, PLATFORM_TARGET_PATH)); |
430 DCHECK(!platform_path.empty()); | 430 DCHECK(!platform_path.empty()); |
431 platform_util::OpenItem(profile_, platform_path); | 431 platform_util::OpenItem(profile_, platform_path, platform_util::OPEN_FILE, |
| 432 platform_util::OpenOperationCallback()); |
432 } | 433 } |
433 | 434 |
434 void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { | 435 void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { |
435 DCHECK_EQ(DownloadItem::COMPLETE, download->GetState()); | 436 DCHECK_EQ(DownloadItem::COMPLETE, download->GetState()); |
436 DCHECK(!download->GetTargetFilePath().empty()); | 437 DCHECK(!download->GetTargetFilePath().empty()); |
437 if (!download->CanOpenDownload()) | 438 if (!download->CanOpenDownload()) |
438 return; | 439 return; |
439 | 440 |
440 if (!DownloadItemModel(download).ShouldPreferOpeningInBrowser()) { | 441 if (!DownloadItemModel(download).ShouldPreferOpeningInBrowser()) { |
441 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_PLATFORM); | 442 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_PLATFORM); |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || | 741 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || |
741 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || | 742 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || |
742 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || | 743 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || |
743 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || | 744 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || |
744 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { | 745 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { |
745 return true; | 746 return true; |
746 } | 747 } |
747 #endif | 748 #endif |
748 return false; | 749 return false; |
749 } | 750 } |
OLD | NEW |