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

Unified Diff: chrome/browser/previews/previews_infobar_delegate.h

Issue 2472863002: Adding offline navigations to the previews blacklist (Closed)
Patch Set: megjablon comments 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/previews/previews_infobar_delegate.h
diff --git a/chrome/browser/previews/previews_infobar_delegate.h b/chrome/browser/previews/previews_infobar_delegate.h
index 1b133ef44a5cfa9851d8faddb6dc88ee2e30f5c0..78d9e1276e75fcf9e2ca67f9a1007bcb4063ffbf 100644
--- a/chrome/browser/previews/previews_infobar_delegate.h
+++ b/chrome/browser/previews/previews_infobar_delegate.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_
#define CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_
+#include "base/callback.h"
#include "components/infobars/core/confirm_infobar_delegate.h"
namespace content {
@@ -25,6 +26,8 @@ class PreviewsInfoBarDelegate : public ConfirmInfoBarDelegate {
OFFLINE, // Offline copy of the page.
};
+ typedef base::Callback<void(bool opt_out)> OnDismissPreviewsInfobarCallback;
+
// Actions on the previews infobar. This enum must remain synchronized with
// the enum of the same name in metrics/histograms/histograms.xml.
enum PreviewsInfoBarAction {
@@ -39,12 +42,16 @@ class PreviewsInfoBarDelegate : public ConfirmInfoBarDelegate {
// Creates a preview infobar and corresponding delegate and adds the infobar
// to InfoBarService.
- static void Create(content::WebContents* web_contents,
- PreviewsInfoBarType infobar_type);
+ static void Create(
+ content::WebContents* web_contents,
+ PreviewsInfoBarType infobar_type,
+ const OnDismissPreviewsInfobarCallback& on_dismiss_callback);
private:
- PreviewsInfoBarDelegate(content::WebContents* web_contents,
- PreviewsInfoBarType infobar_type);
+ PreviewsInfoBarDelegate(
+ content::WebContents* web_contents,
+ PreviewsInfoBarType infobar_type,
+ const OnDismissPreviewsInfobarCallback& on_dismiss_callback);
// ConfirmInfoBarDelegate overrides:
infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
@@ -58,6 +65,8 @@ class PreviewsInfoBarDelegate : public ConfirmInfoBarDelegate {
PreviewsInfoBarType infobar_type_;
+ OnDismissPreviewsInfobarCallback on_dismiss_callback_;
+
DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698