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

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

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/android_download_manager_duplicate_infobar_delegate.h
diff --git a/chrome/browser/android/download/android_download_manager_duplicate_infobar_delegate.h b/chrome/browser/android/download/android_download_manager_duplicate_infobar_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3ea13e16461cb612d72ec6d10b0f636d1bca0f3
--- /dev/null
+++ b/chrome/browser/android/download/android_download_manager_duplicate_infobar_delegate.h
@@ -0,0 +1,56 @@
+// Copyright 2016 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_ANDROID_DOWNLOAD_MANAGER_DUPLICATE_INFOBAR_DELEGATE_H_
+#define CHROME_BROWSER_ANDROID_DOWNLOAD_ANDROID_DOWNLOAD_MANAGER_DUPLICATE_INFOBAR_DELEGATE_H_
+
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "chrome/browser/android/download/duplicate_download_infobar_delegate.h"
+#include "components/infobars/core/infobar_delegate.h"
+
+class InfoBarService;
+
+namespace chrome {
+namespace android {
+
+// An infobar delegate that is initiated from Java side. This infobar is used
+// when user tries to download an OMA DRM file that has already been downloaded.
+class AndroidDownloadManagerDuplicateInfoBarDelegate
+ : public DuplicateDownloadInfoBarDelegate {
+ public:
+ ~AndroidDownloadManagerDuplicateInfoBarDelegate() override;
+
+ static void Create(InfoBarService* infobar_service,
+ const std::string& file_path,
+ jobject chrome_download_delegate,
+ jobject download_info,
+ jboolean is_off_the_record);
+
+ private:
+ AndroidDownloadManagerDuplicateInfoBarDelegate(
+ const std::string& file_path,
+ jobject chrome_download_delegate,
+ jobject download_info,
+ jboolean is_off_the_record);
+
+ // DownloadOverwriteInfoBarDelegate:
+ infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
+ bool Accept() override;
+ bool Cancel() override;
+ std::string GetFilePath() const override;
+ bool IsOffTheRecord() const override;
+
+ std::string file_path_;
+ base::android::ScopedJavaGlobalRef<jobject> chrome_download_delegate_;
+ base::android::ScopedJavaGlobalRef<jobject> download_info_;
+ bool is_off_the_record_;
+
+ DISALLOW_COPY_AND_ASSIGN(AndroidDownloadManagerDuplicateInfoBarDelegate);
+};
+
+} // namespace android
+} // namespace chrome
+
+#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_ANDROID_DOWNLOAD_MANAGER_DUPLICATE_INFOBAR_DELEGATE_H_
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/android/download/android_download_manager_duplicate_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698