| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 typedef base::Callback<void(bool opt_out)> OnDismissPreviewsInfobarCallback; | 29 typedef base::Callback<void(bool opt_out)> OnDismissPreviewsInfobarCallback; |
| 30 | 30 |
| 31 // Actions on the previews infobar. This enum must remain synchronized with | 31 // Actions on the previews infobar. This enum must remain synchronized with |
| 32 // the enum of the same name in metrics/histograms/histograms.xml. | 32 // the enum of the same name in metrics/histograms/histograms.xml. |
| 33 enum PreviewsInfoBarAction { | 33 enum PreviewsInfoBarAction { |
| 34 INFOBAR_SHOWN = 0, | 34 INFOBAR_SHOWN = 0, |
| 35 INFOBAR_LOAD_ORIGINAL_CLICKED = 1, | 35 INFOBAR_LOAD_ORIGINAL_CLICKED = 1, |
| 36 INFOBAR_DISMISSED_BY_USER = 2, | 36 INFOBAR_DISMISSED_BY_USER = 2, |
| 37 INFOBAR_DISMISSED_BY_NAVIGATION = 3, | 37 INFOBAR_DISMISSED_BY_NAVIGATION = 3, |
| 38 INFOBAR_DISMISSED_BY_RELOAD = 4, |
| 38 INFOBAR_INDEX_BOUNDARY | 39 INFOBAR_INDEX_BOUNDARY |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 ~PreviewsInfoBarDelegate() override; | 42 ~PreviewsInfoBarDelegate() override; |
| 42 | 43 |
| 43 // Creates a preview infobar and corresponding delegate and adds the infobar | 44 // Creates a preview infobar and corresponding delegate and adds the infobar |
| 44 // to InfoBarService. | 45 // to InfoBarService. |
| 45 static void Create( | 46 static void Create( |
| 46 content::WebContents* web_contents, | 47 content::WebContents* web_contents, |
| 47 PreviewsInfoBarType infobar_type, | 48 PreviewsInfoBarType infobar_type, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 64 bool LinkClicked(WindowOpenDisposition disposition) override; | 65 bool LinkClicked(WindowOpenDisposition disposition) override; |
| 65 | 66 |
| 66 PreviewsInfoBarType infobar_type_; | 67 PreviewsInfoBarType infobar_type_; |
| 67 | 68 |
| 68 OnDismissPreviewsInfobarCallback on_dismiss_callback_; | 69 OnDismissPreviewsInfobarCallback on_dismiss_callback_; |
| 69 | 70 |
| 70 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); | 71 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ | 74 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ |
| OLD | NEW |