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

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

Issue 2453633006: [downloads] Move platform specific code out of DownloadTargetDeterminer. (Closed)
Patch Set: . Created 4 years, 2 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_download_manager_overwrite_infobar_delegate.cc
diff --git a/chrome/browser/android/download/chrome_download_manager_overwrite_infobar_delegate.cc b/chrome/browser/android/download/chrome_download_manager_overwrite_infobar_delegate.cc
index 5147a80235efec955d4387aa3649e56ce1914a06..c77718ccdf12f5f4944decd67ff9ff9500f24c01 100644
--- a/chrome/browser/android/download/chrome_download_manager_overwrite_infobar_delegate.cc
+++ b/chrome/browser/android/download/chrome_download_manager_overwrite_infobar_delegate.cc
@@ -28,7 +28,7 @@ void DeleteExistingDownloadFileDone(
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DownloadManagerService::GetInstance()->RemoveDownloadsForPath(
download_path);
- callback.Run(download_path);
+ callback.Run(DownloadConfirmationResult::CONFIRMED, download_path);
}
void DeleteExistingDownloadFile(
@@ -46,12 +46,13 @@ void DeleteExistingDownloadFile(
void CreateNewFileDone(
const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback,
- const base::FilePath& target_path, bool verified) {
+ const base::FilePath& target_path,
+ DownloadTargetResult result) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- if (verified)
- callback.Run(target_path);
- else
- callback.Run(base::FilePath());
+ callback.Run(result == DownloadTargetResult::SUCCESS
+ ? DownloadConfirmationResult::CONFIRMED
+ : DownloadConfirmationResult::CANCELED,
+ target_path);
}
} // namespace
@@ -142,7 +143,8 @@ std::string ChromeDownloadManagerOverwriteInfoBarDelegate::GetDirFullPath()
}
void ChromeDownloadManagerOverwriteInfoBarDelegate::InfoBarDismissed() {
- file_selected_callback_.Run(base::FilePath());
+ file_selected_callback_.Run(DownloadConfirmationResult::CANCELED,
+ base::FilePath());
DownloadController::RecordDownloadCancelReason(
DownloadController::CANCEL_REASON_OVERWRITE_INFOBAR_DISMISSED);
}

Powered by Google App Engine
This is Rietveld 408576698