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

Unified Diff: chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.h

Issue 2400213003: [Offline Pages] Fix several infobar bugs. (Closed)
Patch Set: git cl web 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/offline_pages/downloads/offline_page_infobar_delegate.h
diff --git a/chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.h b/chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.h
index 0442df07648d645571109a5990888b05e4d351c8..b748879a3ec685fe3e8d298e0ea448c29f3e990b 100644
--- a/chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.h
+++ b/chrome/browser/android/offline_pages/downloads/offline_page_infobar_delegate.h
@@ -18,17 +18,22 @@ namespace offline_pages {
class OfflinePageInfoBarDelegate
: public chrome::android::DownloadOverwriteInfoBarDelegate {
public:
+ enum class Action { CONFIRM, OVERWRITE };
fgorski 2016/10/10 18:08:21 s/CONFIRM/CREATE_NEW/ Logically both are confirma
+
// Creates an offline page infobar and a delegate and adds the infobar to the
// InfoBarService associated with |web_contents|. |page_name| is the name
// shown for this file in the infobar text.
- static void Create(const base::Closure& confirm_continuation,
+ static void Create(const base::Callback<void(Action)>& confirm_continuation,
+ const std::string& downloads_label,
const std::string& page_name,
content::WebContents* web_contents);
~OfflinePageInfoBarDelegate() override;
private:
- OfflinePageInfoBarDelegate(const base::Closure& confirm_continuation,
- const std::string& page_name);
+ OfflinePageInfoBarDelegate(
+ const base::Callback<void(Action)>& confirm_continuation,
+ const std::string& downloads_label,
+ const std::string& page_name);
// DownloadOverwriteInfoBarDelegate:
infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
@@ -42,8 +47,9 @@ class OfflinePageInfoBarDelegate
OfflinePageInfoBarDelegate* AsOfflinePageInfoBarDelegate() override;
// Continuation called when the user chooses to create a new file.
- base::Closure confirm_continuation_;
+ base::Callback<void(Action)> confirm_continuation_;
+ std::string downloads_label_;
std::string page_name_;
DISALLOW_COPY_AND_ASSIGN(OfflinePageInfoBarDelegate);

Powered by Google App Engine
This is Rietveld 408576698