| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 case STATE_BROKEN_BY_PORTAL: | 213 case STATE_BROKEN_BY_PORTAL: |
| 214 DCHECK(new_state == STATE_NONE || | 214 DCHECK(new_state == STATE_NONE || |
| 215 new_state == STATE_NEEDS_RELOAD); | 215 new_state == STATE_NEEDS_RELOAD); |
| 216 break; | 216 break; |
| 217 case STATE_NEEDS_RELOAD: | 217 case STATE_NEEDS_RELOAD: |
| 218 DCHECK_EQ(STATE_NONE, new_state); | 218 DCHECK_EQ(STATE_NONE, new_state); |
| 219 break; | 219 break; |
| 220 default: | 220 default: |
| 221 NOTREACHED(); | 221 NOTREACHED(); |
| 222 break; | 222 break; |
| 223 }; | 223 } |
| 224 | 224 |
| 225 state_ = new_state; | 225 state_ = new_state; |
| 226 | 226 |
| 227 switch (state_) { | 227 switch (state_) { |
| 228 case STATE_TIMER_RUNNING: | 228 case STATE_TIMER_RUNNING: |
| 229 slow_ssl_load_timer_.Start( | 229 slow_ssl_load_timer_.Start( |
| 230 FROM_HERE, | 230 FROM_HERE, |
| 231 slow_ssl_load_time_, | 231 slow_ssl_load_time_, |
| 232 this, | 232 this, |
| 233 &CaptivePortalTabReloader::OnSlowSSLConnect); | 233 &CaptivePortalTabReloader::OnSlowSSLConnect); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 260 return; | 260 return; |
| 261 } | 261 } |
| 262 | 262 |
| 263 SetState(STATE_NONE); | 263 SetState(STATE_NONE); |
| 264 ReloadTab(); | 264 ReloadTab(); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void CaptivePortalTabReloader::ReloadTab() { | 267 void CaptivePortalTabReloader::ReloadTab() { |
| 268 content::NavigationController* controller = &web_contents_->GetController(); | 268 content::NavigationController* controller = &web_contents_->GetController(); |
| 269 if (!controller->GetActiveEntry()->GetHasPostData()) | 269 if (!controller->GetActiveEntry()->GetHasPostData()) |
| 270 controller->Reload(true); | 270 controller->Reload(content::ReloadType::NORMAL, true); |
| 271 } | 271 } |
| 272 | 272 |
| 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 |