| 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 "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "components/infobars/core/confirm_infobar_delegate.h" | 10 #include "components/infobars/core/confirm_infobar_delegate.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 typedef base::Callback<void(bool opt_out)> OnDismissPreviewsInfobarCallback; | 30 typedef base::Callback<void(bool opt_out)> OnDismissPreviewsInfobarCallback; |
| 31 | 31 |
| 32 // Actions on the previews infobar. This enum must remain synchronized with | 32 // Actions on the previews infobar. This enum must remain synchronized with |
| 33 // the enum of the same name in metrics/histograms/histograms.xml. | 33 // the enum of the same name in metrics/histograms/histograms.xml. |
| 34 enum PreviewsInfoBarAction { | 34 enum PreviewsInfoBarAction { |
| 35 INFOBAR_SHOWN = 0, | 35 INFOBAR_SHOWN = 0, |
| 36 INFOBAR_LOAD_ORIGINAL_CLICKED = 1, | 36 INFOBAR_LOAD_ORIGINAL_CLICKED = 1, |
| 37 INFOBAR_DISMISSED_BY_USER = 2, | 37 INFOBAR_DISMISSED_BY_USER = 2, |
| 38 INFOBAR_DISMISSED_BY_NAVIGATION = 3, | 38 INFOBAR_DISMISSED_BY_NAVIGATION = 3, |
| 39 INFOBAR_DISMISSED_BY_RELOAD = 4, | 39 INFOBAR_DISMISSED_BY_RELOAD = 4, |
| 40 INFOBAR_DISMISSED_BY_TAB_CLOSURE = 5, |
| 40 INFOBAR_INDEX_BOUNDARY | 41 INFOBAR_INDEX_BOUNDARY |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 ~PreviewsInfoBarDelegate() override; | 44 ~PreviewsInfoBarDelegate() override; |
| 44 | 45 |
| 45 // Creates a preview infobar and corresponding delegate and adds the infobar | 46 // Creates a preview infobar and corresponding delegate and adds the infobar |
| 46 // to InfoBarService. | 47 // to InfoBarService. |
| 47 static void Create( | 48 static void Create( |
| 48 content::WebContents* web_contents, | 49 content::WebContents* web_contents, |
| 49 PreviewsInfoBarType infobar_type, | 50 PreviewsInfoBarType infobar_type, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 61 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | 62 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
| 62 int GetIconId() const override; | 63 int GetIconId() const override; |
| 63 bool ShouldExpire(const NavigationDetails& details) const override; | 64 bool ShouldExpire(const NavigationDetails& details) const override; |
| 64 void InfoBarDismissed() override; | 65 void InfoBarDismissed() override; |
| 65 base::string16 GetMessageText() const override; | 66 base::string16 GetMessageText() const override; |
| 66 int GetButtons() const override; | 67 int GetButtons() const override; |
| 67 base::string16 GetLinkText() const override; | 68 base::string16 GetLinkText() const override; |
| 68 bool LinkClicked(WindowOpenDisposition disposition) override; | 69 bool LinkClicked(WindowOpenDisposition disposition) override; |
| 69 | 70 |
| 70 PreviewsInfoBarType infobar_type_; | 71 PreviewsInfoBarType infobar_type_; |
| 72 mutable PreviewsInfoBarAction infobar_dismissed_action_; |
| 71 | 73 |
| 72 const base::string16 message_text_; | 74 const base::string16 message_text_; |
| 73 | 75 |
| 74 OnDismissPreviewsInfobarCallback on_dismiss_callback_; | 76 OnDismissPreviewsInfobarCallback on_dismiss_callback_; |
| 75 | 77 |
| 76 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); | 78 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ | 81 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ |
| OLD | NEW |