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/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // try to detect a portal now, rather than waiting for the timer. | 96 // try to detect a portal now, rather than waiting for the timer. |
97 if (state_ == STATE_TIMER_RUNNING) { | 97 if (state_ == STATE_TIMER_RUNNING) { |
98 OnSlowSSLConnect(); | 98 OnSlowSSLConnect(); |
99 return; | 99 return; |
100 } | 100 } |
101 | 101 |
102 // If the tab needs to reload, do so asynchronously, to avoid reentrancy | 102 // If the tab needs to reload, do so asynchronously, to avoid reentrancy |
103 // issues. | 103 // issues. |
104 if (state_ == STATE_NEEDS_RELOAD) { | 104 if (state_ == STATE_NEEDS_RELOAD) { |
105 base::ThreadTaskRunnerHandle::Get()->PostTask( | 105 base::ThreadTaskRunnerHandle::Get()->PostTask( |
106 FROM_HERE, base::Bind(&CaptivePortalTabReloader::ReloadTabIfNeeded, | 106 FROM_HERE, base::BindOnce(&CaptivePortalTabReloader::ReloadTabIfNeeded, |
107 weak_factory_.GetWeakPtr())); | 107 weak_factory_.GetWeakPtr())); |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
111 void CaptivePortalTabReloader::OnAbort() { | 111 void CaptivePortalTabReloader::OnAbort() { |
112 provisional_main_frame_load_ = false; | 112 provisional_main_frame_load_ = false; |
113 ssl_url_in_redirect_chain_ = false; | 113 ssl_url_in_redirect_chain_ = false; |
114 | 114 |
115 SetState(STATE_NONE); | 115 SetState(STATE_NONE); |
116 } | 116 } |
117 | 117 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 void CaptivePortalTabReloader::MaybeOpenCaptivePortalLoginTab() { | 273 void CaptivePortalTabReloader::MaybeOpenCaptivePortalLoginTab() { |
274 open_login_tab_callback_.Run(); | 274 open_login_tab_callback_.Run(); |
275 } | 275 } |
276 | 276 |
277 void CaptivePortalTabReloader::CheckForCaptivePortal() { | 277 void CaptivePortalTabReloader::CheckForCaptivePortal() { |
278 CaptivePortalService* service = | 278 CaptivePortalService* service = |
279 CaptivePortalServiceFactory::GetForProfile(profile_); | 279 CaptivePortalServiceFactory::GetForProfile(profile_); |
280 if (service) | 280 if (service) |
281 service->DetectCaptivePortal(); | 281 service->DetectCaptivePortal(); |
282 } | 282 } |
OLD | NEW |