OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_TAB_HELPER_H_ | |
6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_TAB_HELPER_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "content/public/browser/web_contents_observer.h" | |
10 #include "content/public/browser/web_contents_user_data.h" | |
11 | |
12 class GURL; | |
13 | |
14 namespace content { | |
15 class RenderFrameHost; | |
16 } | |
17 | |
18 // Per-tab class to help manage the previews infobar. Handles showing the | |
19 // infobar for LitePages when the main frame response came back with a | |
bengr
2016/08/31 23:27:04
This seems like an implementation detail. How abou
megjablon
2016/09/08 00:25:15
Done.
| |
20 // Chrome-Proxy reponse header that has the "q=preview" directive. | |
21 class PreviewsInfoBarTabHelper | |
bengr
2016/08/31 23:27:04
This class should have tests.
megjablon
2016/09/08 00:25:15
Tests are added in https://chromiumcodereview.apps
| |
22 : public content::WebContentsObserver, | |
23 public content::WebContentsUserData<PreviewsInfoBarTabHelper> { | |
24 public: | |
25 ~PreviewsInfoBarTabHelper() override; | |
26 | |
27 // Indicates whether the InfoBar for Data Reduction Proxy preview has been | |
bengr
2016/08/31 23:27:04
for -> for the
Also, what is a DRP preview and ho
megjablon
2016/09/08 00:25:15
Removed. This should just be for all previews, not
| |
28 // shown for the page. | |
29 bool DisplayedPreviewInfoBar() const; | |
bengr
2016/08/31 23:27:04
These are just simple getters and setters so they
megjablon
2016/09/08 00:25:15
Done.
| |
30 void SetDisplayedPreviewInfoBar(bool displayed); | |
31 | |
32 private: | |
33 friend class content::WebContentsUserData<PreviewsInfoBarTabHelper>; | |
34 | |
35 explicit PreviewsInfoBarTabHelper(content::WebContents* web_contents); | |
36 | |
37 // Overridden from content::WebContentsObserver: | |
38 void DidStartProvisionalLoadForFrame( | |
39 content::RenderFrameHost* render_frame_host, | |
40 const GURL& validated_url, | |
41 bool is_error_page, | |
42 bool is_iframe_srcdoc) override; | |
43 void DidFinishNavigation( | |
44 content::NavigationHandle* navigation_handle) override; | |
45 | |
46 // True if the InfoBar for Data Reduction Proxy preview has been shown for | |
bengr
2016/08/31 23:27:04
for -> for the
megjablon
2016/09/08 00:25:15
Done.
| |
47 // the page. | |
48 bool displayed_preview_infobar_; | |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarTabHelper); | |
51 }; | |
52 | |
53 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_TAB_HELPER_H_ | |
OLD | NEW |