Chromium Code Reviews| 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..38a996fbdd580047fb4ee57778f004d1f5f4835d 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)> PreviewsUserLeavePreviewCallback; |
|
megjablon
2016/11/09 00:19:11
Can we call this OnDismissPreviewsInfobarCallback?
RyanSturm
2016/11/09 18:47:13
Done.
|
| + |
| // 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 PreviewsUserLeavePreviewCallback& user_leaving_preview_callback); |
| private: |
| - PreviewsInfoBarDelegate(content::WebContents* web_contents, |
| - PreviewsInfoBarType infobar_type); |
| + PreviewsInfoBarDelegate( |
| + content::WebContents* web_contents, |
| + PreviewsInfoBarType infobar_type, |
| + const PreviewsUserLeavePreviewCallback& user_leaving_preview_callback); |
| // ConfirmInfoBarDelegate overrides: |
| infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
| @@ -58,6 +65,8 @@ class PreviewsInfoBarDelegate : public ConfirmInfoBarDelegate { |
| PreviewsInfoBarType infobar_type_; |
| + PreviewsUserLeavePreviewCallback user_leaving_preview_callback_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); |
| }; |