OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_HELPER_H_ |
6 #define CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_HELPER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // reloading a tab after logging in. | 53 // reloading a tab after logging in. |
54 // | 54 // |
55 // For the design doc, see: | 55 // For the design doc, see: |
56 // https://docs.google.com/document/d/1k-gP2sswzYNvryu9NcgN7q5XrsMlUdlUdoW9WRaEm
fM/edit | 56 // https://docs.google.com/document/d/1k-gP2sswzYNvryu9NcgN7q5XrsMlUdlUdoW9WRaEm
fM/edit |
57 class CaptivePortalTabHelper | 57 class CaptivePortalTabHelper |
58 : public content::WebContentsObserver, | 58 : public content::WebContentsObserver, |
59 public content::NotificationObserver, | 59 public content::NotificationObserver, |
60 public base::NonThreadSafe, | 60 public base::NonThreadSafe, |
61 public content::WebContentsUserData<CaptivePortalTabHelper> { | 61 public content::WebContentsUserData<CaptivePortalTabHelper> { |
62 public: | 62 public: |
63 virtual ~CaptivePortalTabHelper(); | 63 ~CaptivePortalTabHelper() override; |
64 | 64 |
65 // content::WebContentsObserver: | 65 // content::WebContentsObserver: |
66 virtual void RenderViewDeleted( | 66 void RenderViewDeleted(content::RenderViewHost* render_view_host) override; |
67 content::RenderViewHost* render_view_host) override; | |
68 | 67 |
69 virtual void DidStartProvisionalLoadForFrame( | 68 void DidStartProvisionalLoadForFrame( |
70 content::RenderFrameHost* render_frame_host, | 69 content::RenderFrameHost* render_frame_host, |
71 const GURL& validated_url, | 70 const GURL& validated_url, |
72 bool is_error_page, | 71 bool is_error_page, |
73 bool is_iframe_srcdoc) override; | 72 bool is_iframe_srcdoc) override; |
74 | 73 |
75 virtual void DidCommitProvisionalLoadForFrame( | 74 void DidCommitProvisionalLoadForFrame( |
76 content::RenderFrameHost* render_frame_host, | 75 content::RenderFrameHost* render_frame_host, |
77 const GURL& url, | 76 const GURL& url, |
78 ui::PageTransition transition_type) override; | 77 ui::PageTransition transition_type) override; |
79 | 78 |
80 virtual void DidFailProvisionalLoad( | 79 void DidFailProvisionalLoad(content::RenderFrameHost* render_frame_host, |
81 content::RenderFrameHost* render_frame_host, | 80 const GURL& validated_url, |
82 const GURL& validated_url, | 81 int error_code, |
83 int error_code, | 82 const base::string16& error_description) override; |
84 const base::string16& error_description) override; | |
85 | 83 |
86 virtual void DidStopLoading( | 84 void DidStopLoading(content::RenderViewHost* render_view_host) override; |
87 content::RenderViewHost* render_view_host) override; | |
88 | 85 |
89 // content::NotificationObserver: | 86 // content::NotificationObserver: |
90 virtual void Observe( | 87 void Observe(int type, |
91 int type, | 88 const content::NotificationSource& source, |
92 const content::NotificationSource& source, | 89 const content::NotificationDetails& details) override; |
93 const content::NotificationDetails& details) override; | |
94 | 90 |
95 // Called when a certificate interstitial error page is about to be shown. | 91 // Called when a certificate interstitial error page is about to be shown. |
96 void OnSSLCertError(const net::SSLInfo& ssl_info); | 92 void OnSSLCertError(const net::SSLInfo& ssl_info); |
97 | 93 |
98 // A "Login Tab" is a tab that was originally at a captive portal login | 94 // A "Login Tab" is a tab that was originally at a captive portal login |
99 // page. This is set to false when a captive portal is no longer detected. | 95 // page. This is set to false when a captive portal is no longer detected. |
100 bool IsLoginTab() const; | 96 bool IsLoginTab() const; |
101 | 97 |
102 private: | 98 private: |
103 friend class CaptivePortalBrowserTest; | 99 friend class CaptivePortalBrowserTest; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // cross-process navitations. NULL when there's currently no provisional | 148 // cross-process navitations. NULL when there's currently no provisional |
153 // load. | 149 // load. |
154 content::RenderViewHost* provisional_render_view_host_; | 150 content::RenderViewHost* provisional_render_view_host_; |
155 | 151 |
156 content::NotificationRegistrar registrar_; | 152 content::NotificationRegistrar registrar_; |
157 | 153 |
158 DISALLOW_COPY_AND_ASSIGN(CaptivePortalTabHelper); | 154 DISALLOW_COPY_AND_ASSIGN(CaptivePortalTabHelper); |
159 }; | 155 }; |
160 | 156 |
161 #endif // CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_HELPER_H_ | 157 #endif // CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_HELPER_H_ |
OLD | NEW |