Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 2478583004: implementation for new duplicate download UI (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
50 #include "components/prefs/pref_service.h" 50 #include "components/prefs/pref_service.h"
51 #include "content/public/browser/download_item.h" 51 #include "content/public/browser/download_item.h"
52 #include "content/public/browser/download_manager.h" 52 #include "content/public/browser/download_manager.h"
53 #include "content/public/browser/notification_source.h" 53 #include "content/public/browser/notification_source.h"
54 #include "content/public/browser/page_navigator.h" 54 #include "content/public/browser/page_navigator.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 "ui/base/l10n/l10n_util.h" 57 #include "ui/base/l10n/l10n_util.h"
58 58
59 #if BUILDFLAG(ANDROID_JAVA_UI) 59 #if BUILDFLAG(ANDROID_JAVA_UI)
60 #include "chrome/browser/android/download/chrome_download_manager_overwrite_info bar_delegate.h" 60 #include "chrome/browser/android/download/chrome_duplicate_download_infobar_dele gate.h"
61 #include "chrome/browser/infobars/infobar_service.h" 61 #include "chrome/browser/infobars/infobar_service.h"
62 #endif 62 #endif
63 63
64 #if defined(OS_CHROMEOS) 64 #if defined(OS_CHROMEOS)
65 #include "chrome/browser/chromeos/drive/download_handler.h" 65 #include "chrome/browser/chromeos/drive/download_handler.h"
66 #include "chrome/browser/chromeos/drive/file_system_util.h" 66 #include "chrome/browser/chromeos/drive/file_system_util.h"
67 #endif 67 #endif
68 68
69 #if defined(ENABLE_EXTENSIONS) 69 #if defined(ENABLE_EXTENSIONS)
70 #include "chrome/browser/extensions/api/downloads/downloads_api.h" 70 #include "chrome/browser/extensions/api/downloads/downloads_api.h"
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 conflict_action, 610 conflict_action,
611 callback); 611 callback);
612 } 612 }
613 613
614 void ChromeDownloadManagerDelegate::PromptUserForDownloadPath( 614 void ChromeDownloadManagerDelegate::PromptUserForDownloadPath(
615 DownloadItem* download, 615 DownloadItem* download,
616 const base::FilePath& suggested_path, 616 const base::FilePath& suggested_path,
617 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback) { 617 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback) {
618 DCHECK_CURRENTLY_ON(BrowserThread::UI); 618 DCHECK_CURRENTLY_ON(BrowserThread::UI);
619 #if BUILDFLAG(ANDROID_JAVA_UI) 619 #if BUILDFLAG(ANDROID_JAVA_UI)
620 chrome::android::ChromeDownloadManagerOverwriteInfoBarDelegate::Create( 620 chrome::android::ChromeDuplicateDownloadInfoBarDelegate::Create(
621 InfoBarService::FromWebContents(download->GetWebContents()), download, 621 InfoBarService::FromWebContents(download->GetWebContents()), download,
622 suggested_path, callback); 622 suggested_path, callback);
623 #else 623 #else
624 DownloadFilePicker::ShowFilePicker(download, suggested_path, callback); 624 DownloadFilePicker::ShowFilePicker(download, suggested_path, callback);
625 #endif 625 #endif
626 } 626 }
627 627
628 void ChromeDownloadManagerDelegate::DetermineLocalPath( 628 void ChromeDownloadManagerDelegate::DetermineLocalPath(
629 DownloadItem* download, 629 DownloadItem* download,
630 const base::FilePath& virtual_path, 630 const base::FilePath& virtual_path,
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || 807 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) ||
808 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || 808 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) ||
809 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || 809 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) ||
810 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || 810 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) ||
811 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { 811 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) {
812 return true; 812 return true;
813 } 813 }
814 #endif 814 #endif
815 return false; 815 return false;
816 } 816 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698