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" |
11 #include "base/threading/non_thread_safe.h" | 11 #include "base/threading/non_thread_safe.h" |
12 #include "chrome/browser/captive_portal/captive_portal_service.h" | 12 #include "chrome/browser/captive_portal/captive_portal_service.h" |
13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
16 #include "content/public/browser/web_contents_user_data.h" | 16 #include "content/public/browser/web_contents_user_data.h" |
17 #include "webkit/common/resource_type.h" | 17 #include "webkit/common/resource_type.h" |
18 | 18 |
19 class GURL; | 19 class GURL; |
20 class Profile; | 20 class Profile; |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 class WebContents; | 23 class WebContents; |
24 } | 24 } |
25 | 25 |
26 namespace net { | 26 namespace net { |
27 class SSLInfo; | 27 class SSLInfo; |
28 } | 28 } |
29 | 29 |
30 namespace captive_portal { | |
31 | |
32 class CaptivePortalLoginDetector; | 30 class CaptivePortalLoginDetector; |
33 class CaptivePortalTabReloader; | 31 class CaptivePortalTabReloader; |
34 | 32 |
35 // Along with the classes it owns, responsible for detecting page loads broken | 33 // Along with the classes it owns, responsible for detecting page loads broken |
36 // by a captive portal, triggering captive portal checks on navigation events | 34 // by a captive portal, triggering captive portal checks on navigation events |
37 // that may indicate a captive portal is present, or has been removed / logged | 35 // that may indicate a captive portal is present, or has been removed / logged |
38 // in to, and taking any correcting actions. | 36 // in to, and taking any correcting actions. |
39 // | 37 // |
40 // It acts as a WebContentsObserver for its CaptivePortalLoginDetector and | 38 // It acts as a WebContentsObserver for its CaptivePortalLoginDetector and |
41 // CaptivePortalTabReloader. It filters out non-main-frame resource loads, and | 39 // CaptivePortalTabReloader. It filters out non-main-frame resource loads, and |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 114 |
117 friend class content::WebContentsUserData<CaptivePortalTabHelper>; | 115 friend class content::WebContentsUserData<CaptivePortalTabHelper>; |
118 explicit CaptivePortalTabHelper(content::WebContents* web_contents); | 116 explicit CaptivePortalTabHelper(content::WebContents* web_contents); |
119 | 117 |
120 // Called by Observe in response to the corresponding event. | 118 // Called by Observe in response to the corresponding event. |
121 void OnRedirect(int child_id, | 119 void OnRedirect(int child_id, |
122 ResourceType::Type resource_type, | 120 ResourceType::Type resource_type, |
123 const GURL& new_url); | 121 const GURL& new_url); |
124 | 122 |
125 // Called by Observe in response to the corresponding event. | 123 // Called by Observe in response to the corresponding event. |
126 void OnCaptivePortalResults(Result previous_result, Result result); | 124 void OnCaptivePortalResults( |
| 125 captive_portal::CaptivePortalResult previous_result, |
| 126 captive_portal::CaptivePortalResult result); |
127 | 127 |
128 void OnLoadAborted(); | 128 void OnLoadAborted(); |
129 | 129 |
130 // Called to indicate a tab is at, or is navigating to, the captive portal | 130 // Called to indicate a tab is at, or is navigating to, the captive portal |
131 // login page. | 131 // login page. |
132 void SetIsLoginTab(); | 132 void SetIsLoginTab(); |
133 | 133 |
134 // |this| takes ownership of |tab_reloader|. | 134 // |this| takes ownership of |tab_reloader|. |
135 void SetTabReloaderForTest(CaptivePortalTabReloader* tab_reloader); | 135 void SetTabReloaderForTest(CaptivePortalTabReloader* tab_reloader); |
136 | 136 |
(...skipping 23 matching lines...) Expand all Loading... |
160 // the currently displayed RenderViewHost or a pending RenderViewHost for | 160 // the currently displayed RenderViewHost or a pending RenderViewHost for |
161 // cross-process navitations. NULL when there's currently no provisional | 161 // cross-process navitations. NULL when there's currently no provisional |
162 // load. | 162 // load. |
163 content::RenderViewHost* provisional_render_view_host_; | 163 content::RenderViewHost* provisional_render_view_host_; |
164 | 164 |
165 content::NotificationRegistrar registrar_; | 165 content::NotificationRegistrar registrar_; |
166 | 166 |
167 DISALLOW_COPY_AND_ASSIGN(CaptivePortalTabHelper); | 167 DISALLOW_COPY_AND_ASSIGN(CaptivePortalTabHelper); |
168 }; | 168 }; |
169 | 169 |
170 } // namespace captive_portal | |
171 | |
172 #endif // CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_HELPER_H_ | 170 #endif // CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_HELPER_H_ |
OLD | NEW |