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

Unified Diff: chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc

Issue 2453633006: [downloads] Move platform specific code out of DownloadTargetDeterminer. (Closed)
Patch Set: . Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc
diff --git a/chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc b/chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc
index 4c468d902875ab486d1842874523375889c01e58..9378ea2bf9bfdbf2e8236c51c04b62d0c39c0a13 100644
--- a/chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc
+++ b/chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc
@@ -19,13 +19,14 @@
namespace {
void CreateNewFileDone(
- const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback,
- const base::FilePath& target_path, bool verified) {
+ const DownloadTargetDeterminerDelegate::ConfirmationCallback& callback,
+ PathValidationResult result,
+ const base::FilePath& target_path) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- if (verified)
- callback.Run(target_path);
+ if (result == PathValidationResult::SUCCESS)
+ callback.Run(DownloadConfirmationResult::CONFIRMED, target_path);
else
- callback.Run(base::FilePath());
+ callback.Run(DownloadConfirmationResult::FAILED, base::FilePath());
}
} // namespace
@@ -44,7 +45,7 @@ void ChromeDuplicateDownloadInfoBarDelegate::Create(
InfoBarService* infobar_service,
content::DownloadItem* download_item,
const base::FilePath& file_path,
- const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback) {
+ const DownloadTargetDeterminerDelegate::ConfirmationCallback& callback) {
infobar_service->AddInfoBar(DuplicateDownloadInfoBar::CreateInfoBar(
base::WrapUnique(new ChromeDuplicateDownloadInfoBarDelegate(
download_item, file_path, callback))));
@@ -59,7 +60,7 @@ void ChromeDuplicateDownloadInfoBarDelegate::OnDownloadDestroyed(
ChromeDuplicateDownloadInfoBarDelegate::ChromeDuplicateDownloadInfoBarDelegate(
content::DownloadItem* download_item,
const base::FilePath& file_path,
- const DownloadTargetDeterminerDelegate::FileSelectedCallback&
+ const DownloadTargetDeterminerDelegate::ConfirmationCallback&
file_selected_callback)
: download_item_(download_item),
file_path_(file_path),
@@ -95,7 +96,8 @@ bool ChromeDuplicateDownloadInfoBarDelegate::Cancel() {
if (!download_item_)
return true;
- file_selected_callback_.Run(base::FilePath());
+ file_selected_callback_.Run(DownloadConfirmationResult::CANCELED,
+ base::FilePath());
// TODO(qinmin): rename this histogram enum.
DownloadController::RecordDownloadCancelReason(
DownloadController::CANCEL_REASON_OVERWRITE_INFOBAR_DISMISSED);

Powered by Google App Engine
This is Rietveld 408576698