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_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_TAB_HELPER_H_ |
6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_TAB_HELPER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
10 #include "content/public/browser/web_contents_user_data.h" | 10 #include "content/public/browser/web_contents_user_data.h" |
11 | 11 |
12 class GURL; | |
13 | |
14 namespace content { | |
15 class RenderFrameHost; | |
16 } | |
17 | |
18 // Tracks whether a previews infobar has been shown for a page. Handles showing | 12 // Tracks whether a previews infobar has been shown for a page. Handles showing |
19 // the infobar when the main frame response indicates a Lite Page. | 13 // the infobar when the main frame response indicates a Lite Page. |
20 class PreviewsInfoBarTabHelper | 14 class PreviewsInfoBarTabHelper |
21 : public content::WebContentsObserver, | 15 : public content::WebContentsObserver, |
22 public content::WebContentsUserData<PreviewsInfoBarTabHelper> { | 16 public content::WebContentsUserData<PreviewsInfoBarTabHelper> { |
23 public: | 17 public: |
24 ~PreviewsInfoBarTabHelper() override; | 18 ~PreviewsInfoBarTabHelper() override; |
25 | 19 |
26 // Indicates whether the InfoBar for a preview has been shown for the page. | 20 // Indicates whether the InfoBar for a preview has been shown for the page. |
27 bool displayed_preview_infobar() const { | 21 bool displayed_preview_infobar() const { |
(...skipping 25 matching lines...) Expand all Loading... |
53 // True if the InfoBar for a preview has been shown for the page. | 47 // True if the InfoBar for a preview has been shown for the page. |
54 bool displayed_preview_infobar_; | 48 bool displayed_preview_infobar_; |
55 | 49 |
56 // Whether an offline preview has been shown for this page. | 50 // Whether an offline preview has been shown for this page. |
57 bool is_showing_offline_preview_; | 51 bool is_showing_offline_preview_; |
58 | 52 |
59 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarTabHelper); | 53 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarTabHelper); |
60 }; | 54 }; |
61 | 55 |
62 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_TAB_HELPER_H_ | 56 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_TAB_HELPER_H_ |
OLD | NEW |