| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "components/infobars/core/confirm_infobar_delegate.h" | 9 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 INFOBAR_INDEX_BOUNDARY | 38 INFOBAR_INDEX_BOUNDARY |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 ~PreviewsInfoBarDelegate() override; | 41 ~PreviewsInfoBarDelegate() override; |
| 42 | 42 |
| 43 // Creates a preview infobar and corresponding delegate and adds the infobar | 43 // Creates a preview infobar and corresponding delegate and adds the infobar |
| 44 // to InfoBarService. | 44 // to InfoBarService. |
| 45 static void Create( | 45 static void Create( |
| 46 content::WebContents* web_contents, | 46 content::WebContents* web_contents, |
| 47 PreviewsInfoBarType infobar_type, | 47 PreviewsInfoBarType infobar_type, |
| 48 bool is_data_saver_user, |
| 48 const OnDismissPreviewsInfobarCallback& on_dismiss_callback); | 49 const OnDismissPreviewsInfobarCallback& on_dismiss_callback); |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 PreviewsInfoBarDelegate( | 52 PreviewsInfoBarDelegate( |
| 52 content::WebContents* web_contents, | 53 content::WebContents* web_contents, |
| 53 PreviewsInfoBarType infobar_type, | 54 PreviewsInfoBarType infobar_type, |
| 55 bool is_data_saver_user, |
| 54 const OnDismissPreviewsInfobarCallback& on_dismiss_callback); | 56 const OnDismissPreviewsInfobarCallback& on_dismiss_callback); |
| 55 | 57 |
| 56 // ConfirmInfoBarDelegate overrides: | 58 // ConfirmInfoBarDelegate overrides: |
| 57 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | 59 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
| 58 int GetIconId() const override; | 60 int GetIconId() const override; |
| 59 bool ShouldExpire(const NavigationDetails& details) const override; | 61 bool ShouldExpire(const NavigationDetails& details) const override; |
| 60 void InfoBarDismissed() override; | 62 void InfoBarDismissed() override; |
| 61 base::string16 GetMessageText() const override; | 63 base::string16 GetMessageText() const override; |
| 62 int GetButtons() const override; | 64 int GetButtons() const override; |
| 63 base::string16 GetLinkText() const override; | 65 base::string16 GetLinkText() const override; |
| 64 bool LinkClicked(WindowOpenDisposition disposition) override; | 66 bool LinkClicked(WindowOpenDisposition disposition) override; |
| 65 | 67 |
| 66 PreviewsInfoBarType infobar_type_; | 68 PreviewsInfoBarType infobar_type_; |
| 67 | 69 |
| 70 const bool is_data_saver_user_; |
| 71 |
| 68 OnDismissPreviewsInfobarCallback on_dismiss_callback_; | 72 OnDismissPreviewsInfobarCallback on_dismiss_callback_; |
| 69 | 73 |
| 70 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); | 74 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); |
| 71 }; | 75 }; |
| 72 | 76 |
| 73 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ | 77 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ |
| OLD | NEW |