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_tab_reloader.h" | 9 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h" |
10 #include "chrome/browser/captive_portal/captive_portal_service_factory.h" | 10 #include "chrome/browser/captive_portal/captive_portal_service_factory.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // May have been aborting the load of an error page. | 114 // May have been aborting the load of an error page. |
115 pending_error_code_ = net::OK; | 115 pending_error_code_ = net::OK; |
116 | 116 |
117 tab_reloader_->OnAbort(); | 117 tab_reloader_->OnAbort(); |
118 return; | 118 return; |
119 } | 119 } |
120 | 120 |
121 pending_error_code_ = error_code; | 121 pending_error_code_ = error_code; |
122 } | 122 } |
123 | 123 |
124 void CaptivePortalTabHelper::DidStopLoading() { | 124 void CaptivePortalTabHelper::DidStopLoading( |
| 125 content::RenderViewHost* render_view_host) { |
125 DCHECK(CalledOnValidThread()); | 126 DCHECK(CalledOnValidThread()); |
126 | 127 |
127 login_detector_->OnStoppedLoading(); | 128 login_detector_->OnStoppedLoading(); |
128 } | 129 } |
129 | 130 |
130 void CaptivePortalTabHelper::Observe( | 131 void CaptivePortalTabHelper::Observe( |
131 int type, | 132 int type, |
132 const content::NotificationSource& source, | 133 const content::NotificationSource& source, |
133 const content::NotificationDetails& details) { | 134 const content::NotificationDetails& details) { |
134 DCHECK(CalledOnValidThread()); | 135 DCHECK(CalledOnValidThread()); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // Otherwise, open a login tab. Only end up here when a captive portal result | 208 // Otherwise, open a login tab. Only end up here when a captive portal result |
208 // was received, so it's safe to assume |profile_| has a CaptivePortalService. | 209 // was received, so it's safe to assume |profile_| has a CaptivePortalService. |
209 TabContents* tab_contents = chrome::AddSelectedTabWithURL( | 210 TabContents* tab_contents = chrome::AddSelectedTabWithURL( |
210 browser, | 211 browser, |
211 CaptivePortalServiceFactory::GetForProfile(profile_)->test_url(), | 212 CaptivePortalServiceFactory::GetForProfile(profile_)->test_url(), |
212 content::PAGE_TRANSITION_TYPED); | 213 content::PAGE_TRANSITION_TYPED); |
213 tab_contents->captive_portal_tab_helper()->SetIsLoginTab(); | 214 tab_contents->captive_portal_tab_helper()->SetIsLoginTab(); |
214 } | 215 } |
215 | 216 |
216 } // namespace captive_portal | 217 } // namespace captive_portal |
OLD | NEW |