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_reloader.h" | 5 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/captive_portal/captive_portal_service.h" | 10 #include "chrome/browser/captive_portal/captive_portal_service.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // The page returned an error out before the timer triggered. Go ahead and | 93 // The page returned an error out before the timer triggered. Go ahead and |
94 // try to detect a portal now, rather than waiting for the timer. | 94 // try to detect a portal now, rather than waiting for the timer. |
95 if (state_ == STATE_TIMER_RUNNING) { | 95 if (state_ == STATE_TIMER_RUNNING) { |
96 OnSlowSSLConnect(); | 96 OnSlowSSLConnect(); |
97 return; | 97 return; |
98 } | 98 } |
99 | 99 |
100 // If the tab needs to reload, do so asynchronously, to avoid reentrancy | 100 // If the tab needs to reload, do so asynchronously, to avoid reentrancy |
101 // issues. | 101 // issues. |
102 if (state_ == STATE_NEEDS_RELOAD) { | 102 if (state_ == STATE_NEEDS_RELOAD) { |
103 MessageLoop::current()->PostTask( | 103 base::MessageLoop::current()->PostTask( |
104 FROM_HERE, | 104 FROM_HERE, |
105 base::Bind(&CaptivePortalTabReloader::ReloadTabIfNeeded, | 105 base::Bind(&CaptivePortalTabReloader::ReloadTabIfNeeded, |
106 weak_factory_.GetWeakPtr())); | 106 weak_factory_.GetWeakPtr())); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 void CaptivePortalTabReloader::OnAbort() { | 110 void CaptivePortalTabReloader::OnAbort() { |
111 provisional_main_frame_load_ = false; | 111 provisional_main_frame_load_ = false; |
112 ssl_url_in_redirect_chain_ = false; | 112 ssl_url_in_redirect_chain_ = false; |
113 | 113 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 } | 274 } |
275 | 275 |
276 void CaptivePortalTabReloader::CheckForCaptivePortal() { | 276 void CaptivePortalTabReloader::CheckForCaptivePortal() { |
277 CaptivePortalService* service = | 277 CaptivePortalService* service = |
278 CaptivePortalServiceFactory::GetForProfile(profile_); | 278 CaptivePortalServiceFactory::GetForProfile(profile_); |
279 if (service) | 279 if (service) |
280 service->DetectCaptivePortal(); | 280 service->DetectCaptivePortal(); |
281 } | 281 } |
282 | 282 |
283 } // namespace captive_portal | 283 } // namespace captive_portal |
OLD | NEW |