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

Unified Diff: chrome/browser/android/download/duplicate_download_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/duplicate_download_infobar_delegate.h
diff --git a/chrome/browser/android/download/duplicate_download_infobar_delegate.h b/chrome/browser/android/download/duplicate_download_infobar_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..3033e1d09c44a525df10e424c52d65425cdf64d6
--- /dev/null
+++ b/chrome/browser/android/download/duplicate_download_infobar_delegate.h
@@ -0,0 +1,40 @@
+// 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_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_
+#define CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_
+
+#include "components/infobars/core/confirm_infobar_delegate.h"
+
+class InfoBarService;
+
+namespace chrome {
+namespace android {
+
+// An infobar that asks if user wants to continue downloading when there is
+// already a duplicate file in storage. If user chooses to proceed,
+// a new file will be created.
+// Note that this infobar does not expire if the user subsequently navigates,
+// since such navigations won't automatically cancel the underlying download.
+class DuplicateDownloadInfoBarDelegate : public ConfirmInfoBarDelegate {
+ public:
+ // Gets the file path to be downloaded.
+ virtual std::string GetFilePath() const = 0;
+
+ // Whether the download is for offline page.
+ virtual bool IsOfflinePage() const;
+
+ virtual std::string GetPageURL() const;
+
+ virtual bool IsOffTheRecord() const;
+
+ // ConfirmInfoBarDelegate implementation.
+ base::string16 GetMessageText() const override;
+ bool ShouldExpire(const NavigationDetails& details) const override;
+};
+
+} // namespace android
+} // namespace chrome
+
+#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698