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

Unified Diff: chrome/browser/android/download/download_overwrite_infobar_delegate_for_android_download_manager.h

Issue 580043002: [Android] Prompt with infobar on filename conflict (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: used Java DownloadInfo and fixed nits Created 5 years, 10 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/download_overwrite_infobar_delegate_for_android_download_manager.h
diff --git a/chrome/browser/android/download/download_overwrite_infobar_delegate_for_android_download_manager.h b/chrome/browser/android/download/download_overwrite_infobar_delegate_for_android_download_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..8f1760e6f96a2d01deb86f23a5dd998e43ef6899
--- /dev/null
+++ b/chrome/browser/android/download/download_overwrite_infobar_delegate_for_android_download_manager.h
@@ -0,0 +1,64 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_FOR_ANDROID_DOWNLOAD_MANAGER_H_
+#define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_FOR_ANDROID_DOWNLOAD_MANAGER_H_
+
+#include "base/android/jni_weak_ref.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/callback.h"
+#include "base/files/file_path.h"
+#include "chrome/browser/android/download/download_overwrite_infobar_delegate.h"
+#include "components/infobars/core/infobar_delegate.h"
+
+using base::android::ScopedJavaGlobalRef;
+
+class InfoBarService;
+
+namespace chrome {
+namespace android {
+
+// An infobar delegate that is initiated from Java side.
+class DownloadOverwriteInfoBarDelegateForAndroidDownloadManager
Ted C 2015/03/03 01:14:44 Although I do like this for completeness, the leng
Changwan Ryu 2015/03/04 05:15:03 Changed as suggested.
+ : public DownloadOverwriteInfoBarDelegate {
+ public:
+ ~DownloadOverwriteInfoBarDelegateForAndroidDownloadManager() override;
+
+ static void Create(InfoBarService* infobar_service,
+ const std::string& file_name,
+ const std::string& dir_name,
+ const std::string& dir_full_path,
+ JavaObjectWeakGlobalRef chrome_download_delegate,
+ const ScopedJavaGlobalRef<jobject>& download_info);
+
+ private:
+ DownloadOverwriteInfoBarDelegateForAndroidDownloadManager(
+ const std::string& file_name,
+ const std::string& dir_name,
+ const std::string& dir_full_path,
+ JavaObjectWeakGlobalRef chrome_download_delegate,
+ const ScopedJavaGlobalRef<jobject>& download_info);
+
+ // DownloadOverwriteInfoBarDelegate:
+ void OverwriteExistingFile() override;
+ void CreateNewFile() override;
+ std::string GetFileName() const override;
+ std::string GetDirName() const override;
+ std::string GetDirFullPath() const override;
+ void InfoBarDismissed() override;
Peter Kasting 2015/03/02 21:05:15 Why do you override InfoBarDismissed() when your n
Changwan Ryu 2015/03/04 05:15:04 Done.
+
+ std::string file_name_;
+ std::string dir_name_;
+ std::string dir_full_path_;
+ JavaObjectWeakGlobalRef chrome_download_delegate_;
+ ScopedJavaGlobalRef<jobject> download_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(
+ DownloadOverwriteInfoBarDelegateForAndroidDownloadManager);
+};
+
+} // namespace android
+} // namespace chrome
+
+#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_FOR_ANDROID_DOWNLOAD_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698