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 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" | 5 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/captive_portal/captive_portal_login_detector.h" | 8 #include "chrome/browser/captive_portal/captive_portal_login_detector.h" |
9 #include "chrome/browser/captive_portal/captive_portal_service_factory.h" | 9 #include "chrome/browser/captive_portal/captive_portal_service_factory.h" |
10 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h" | 10 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 void CaptivePortalTabHelper::OnSSLCertError(const net::SSLInfo& ssl_info) { | 188 void CaptivePortalTabHelper::OnSSLCertError(const net::SSLInfo& ssl_info) { |
189 tab_reloader_->OnSSLCertError(ssl_info); | 189 tab_reloader_->OnSSLCertError(ssl_info); |
190 } | 190 } |
191 | 191 |
192 bool CaptivePortalTabHelper::IsLoginTab() const { | 192 bool CaptivePortalTabHelper::IsLoginTab() const { |
193 return login_detector_->is_login_tab(); | 193 return login_detector_->is_login_tab(); |
194 } | 194 } |
195 | 195 |
196 void CaptivePortalTabHelper::OnRedirect(int child_id, | 196 void CaptivePortalTabHelper::OnRedirect(int child_id, |
197 ResourceType::Type resource_type, | 197 ResourceType resource_type, |
198 const GURL& new_url) { | 198 const GURL& new_url) { |
199 // Only main frame redirects for the provisional RenderViewHost matter. | 199 // Only main frame redirects for the provisional RenderViewHost matter. |
200 if (resource_type != ResourceType::MAIN_FRAME || | 200 if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME || |
201 !provisional_render_view_host_ || | 201 !provisional_render_view_host_ || |
202 provisional_render_view_host_->GetProcess()->GetID() != child_id) { | 202 provisional_render_view_host_->GetProcess()->GetID() != child_id) { |
203 return; | 203 return; |
204 } | 204 } |
205 | 205 |
206 tab_reloader_->OnRedirect(new_url.SchemeIsSecure()); | 206 tab_reloader_->OnRedirect(new_url.SchemeIsSecure()); |
207 } | 207 } |
208 | 208 |
209 void CaptivePortalTabHelper::OnCaptivePortalResults( | 209 void CaptivePortalTabHelper::OnCaptivePortalResults( |
210 CaptivePortalResult previous_result, | 210 CaptivePortalResult previous_result, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // Otherwise, open a login tab. Only end up here when a captive portal result | 258 // Otherwise, open a login tab. Only end up here when a captive portal result |
259 // was received, so it's safe to assume |profile_| has a CaptivePortalService. | 259 // was received, so it's safe to assume |profile_| has a CaptivePortalService. |
260 content::WebContents* web_contents = chrome::AddSelectedTabWithURL( | 260 content::WebContents* web_contents = chrome::AddSelectedTabWithURL( |
261 browser, | 261 browser, |
262 CaptivePortalServiceFactory::GetForProfile(profile_)->test_url(), | 262 CaptivePortalServiceFactory::GetForProfile(profile_)->test_url(), |
263 content::PAGE_TRANSITION_TYPED); | 263 content::PAGE_TRANSITION_TYPED); |
264 CaptivePortalTabHelper* captive_portal_tab_helper = | 264 CaptivePortalTabHelper* captive_portal_tab_helper = |
265 CaptivePortalTabHelper::FromWebContents(web_contents); | 265 CaptivePortalTabHelper::FromWebContents(web_contents); |
266 captive_portal_tab_helper->SetIsLoginTab(); | 266 captive_portal_tab_helper->SetIsLoginTab(); |
267 } | 267 } |
OLD | NEW |