| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "content/public/browser/download_item.h" | 50 #include "content/public/browser/download_item.h" |
| 51 #include "content/public/browser/download_manager.h" | 51 #include "content/public/browser/download_manager.h" |
| 52 #include "content/public/browser/notification_source.h" | 52 #include "content/public/browser/notification_source.h" |
| 53 #include "content/public/browser/page_navigator.h" | 53 #include "content/public/browser/page_navigator.h" |
| 54 #include "extensions/features/features.h" | 54 #include "extensions/features/features.h" |
| 55 #include "net/base/filename_util.h" | 55 #include "net/base/filename_util.h" |
| 56 #include "net/base/mime_util.h" | 56 #include "net/base/mime_util.h" |
| 57 #include "ppapi/features/features.h" | 57 #include "ppapi/features/features.h" |
| 58 #include "ui/base/l10n/l10n_util.h" | 58 #include "ui/base/l10n/l10n_util.h" |
| 59 | 59 |
| 60 #if BUILDFLAG(ANDROID_JAVA_UI) | 60 #if defined(OS_ANDROID) |
| 61 #include "chrome/browser/android/download/chrome_duplicate_download_infobar_dele
gate.h" | 61 #include "chrome/browser/android/download/chrome_duplicate_download_infobar_dele
gate.h" |
| 62 #include "chrome/browser/infobars/infobar_service.h" | 62 #include "chrome/browser/infobars/infobar_service.h" |
| 63 #endif | 63 #endif |
| 64 | 64 |
| 65 #if defined(OS_CHROMEOS) | 65 #if defined(OS_CHROMEOS) |
| 66 #include "chrome/browser/chromeos/drive/download_handler.h" | 66 #include "chrome/browser/chromeos/drive/download_handler.h" |
| 67 #include "chrome/browser/chromeos/drive/file_system_util.h" | 67 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 68 #endif | 68 #endif |
| 69 | 69 |
| 70 #if BUILDFLAG(ENABLE_EXTENSIONS) | 70 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 create_directory, | 610 create_directory, |
| 611 conflict_action, | 611 conflict_action, |
| 612 callback); | 612 callback); |
| 613 } | 613 } |
| 614 | 614 |
| 615 void ChromeDownloadManagerDelegate::PromptUserForDownloadPath( | 615 void ChromeDownloadManagerDelegate::PromptUserForDownloadPath( |
| 616 DownloadItem* download, | 616 DownloadItem* download, |
| 617 const base::FilePath& suggested_path, | 617 const base::FilePath& suggested_path, |
| 618 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback) { | 618 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback) { |
| 619 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 619 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 620 #if BUILDFLAG(ANDROID_JAVA_UI) | 620 #if defined(OS_ANDROID) |
| 621 content::WebContents* web_contents = download->GetWebContents(); | 621 content::WebContents* web_contents = download->GetWebContents(); |
| 622 if (!web_contents) { | 622 if (!web_contents) { |
| 623 callback.Run(base::FilePath()); | 623 callback.Run(base::FilePath()); |
| 624 return; | 624 return; |
| 625 } | 625 } |
| 626 chrome::android::ChromeDuplicateDownloadInfoBarDelegate::Create( | 626 chrome::android::ChromeDuplicateDownloadInfoBarDelegate::Create( |
| 627 InfoBarService::FromWebContents(web_contents), download, | 627 InfoBarService::FromWebContents(web_contents), download, |
| 628 suggested_path, callback); | 628 suggested_path, callback); |
| 629 #else | 629 #else |
| 630 DownloadFilePicker::ShowFilePicker(download, suggested_path, callback); | 630 DownloadFilePicker::ShowFilePicker(download, suggested_path, callback); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || | 813 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || |
| 814 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || | 814 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || |
| 815 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || | 815 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || |
| 816 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || | 816 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || |
| 817 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { | 817 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { |
| 818 return true; | 818 return true; |
| 819 } | 819 } |
| 820 #endif | 820 #endif |
| 821 return false; | 821 return false; |
| 822 } | 822 } |
| OLD | NEW |