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

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

Issue 2478583004: implementation for new duplicate download UI (Closed)
Patch Set: do null check on webcontents 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/download/chrome_download_delegate.cc
diff --git a/chrome/browser/android/download/chrome_download_delegate.cc b/chrome/browser/android/download/chrome_download_delegate.cc
index 8979f55395a903ce1e9761788964f6589ae40226..a9eb13fa5170ae101eb1a00c5d72c10d263ad0d4 100644
--- a/chrome/browser/android/download/chrome_download_delegate.cc
+++ b/chrome/browser/android/download/chrome_download_delegate.cc
@@ -15,7 +15,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/files/file_path.h"
-#include "chrome/browser/android/download/android_download_manager_overwrite_infobar_delegate.h"
+#include "chrome/browser/android/download/android_download_manager_duplicate_infobar_delegate.h"
#include "chrome/browser/android/download/download_controller_base.h"
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/infobars/infobar_service.h"
@@ -62,28 +62,24 @@ bool ChromeDownloadDelegate::EnqueueDownloadManagerRequest(
env, chrome_download_delegate, overwrite, download_info);
}
-// Called when we need to interrupt download and ask users whether to overwrite
-// an existing file.
-static void LaunchDownloadOverwriteInfoBar(
+// Called when we need to interrupt download and ask user whether to proceed
+// as there is already an existing file.
+static void LaunchDuplicateDownloadInfoBar(
JNIEnv* env,
const JavaParamRef<jclass>& clazz,
const JavaParamRef<jobject>& delegate,
const JavaParamRef<jobject>& tab,
const JavaParamRef<jobject>& download_info,
- const JavaParamRef<jstring>& jfile_name,
- const JavaParamRef<jstring>& jdir_name,
- const JavaParamRef<jstring>& jdir_full_path) {
+ const JavaParamRef<jstring>& jfile_path,
+ jboolean is_incognito) {
TabAndroid* tab_android = TabAndroid::GetNativeTab(env, tab);
- std::string file_name =
- base::android::ConvertJavaStringToUTF8(env, jfile_name);
- std::string dir_name = base::android::ConvertJavaStringToUTF8(env, jdir_name);
- std::string dir_full_path =
- base::android::ConvertJavaStringToUTF8(env, jdir_full_path);
+ std::string file_path =
+ base::android::ConvertJavaStringToUTF8(env, jfile_path);
- chrome::android::AndroidDownloadManagerOverwriteInfoBarDelegate::Create(
- InfoBarService::FromWebContents(tab_android->web_contents()), file_name,
- dir_name, dir_full_path, delegate, download_info);
+ chrome::android::AndroidDownloadManagerDuplicateInfoBarDelegate::Create(
+ InfoBarService::FromWebContents(tab_android->web_contents()), file_path,
+ delegate, download_info, is_incognito);
}
static void LaunchPermissionUpdateInfoBar(

Powered by Google App Engine
This is Rietveld 408576698