| 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_service.h" | 5 #include "chrome/browser/captive_portal/captive_portal_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 url_fetcher_.reset(); | 345 url_fetcher_.reset(); |
| 346 check_captive_portal_timer_.Stop(); | 346 check_captive_portal_timer_.Stop(); |
| 347 state_ = STATE_IDLE; | 347 state_ = STATE_IDLE; |
| 348 | 348 |
| 349 // Since a captive portal request was queued or running, something may be | 349 // Since a captive portal request was queued or running, something may be |
| 350 // expecting to receive a captive portal result. | 350 // expecting to receive a captive portal result. |
| 351 DetectCaptivePortal(); | 351 DetectCaptivePortal(); |
| 352 } | 352 } |
| 353 } | 353 } |
| 354 | 354 |
| 355 // Takes a content::URLFetcher that has finished trying to retrieve the test | 355 // Takes a net::URLFetcher that has finished trying to retrieve the test |
| 356 // URL, and returns a CaptivePortalService::Result based on its result. | 356 // URL, and returns a CaptivePortalService::Result based on its result. |
| 357 Result CaptivePortalService::GetCaptivePortalResultFromResponse( | 357 Result CaptivePortalService::GetCaptivePortalResultFromResponse( |
| 358 const net::URLFetcher* url_fetcher, | 358 const net::URLFetcher* url_fetcher, |
| 359 base::TimeDelta* retry_after) const { | 359 base::TimeDelta* retry_after) const { |
| 360 DCHECK(retry_after); | 360 DCHECK(retry_after); |
| 361 DCHECK(!url_fetcher->GetStatus().is_io_pending()); | 361 DCHECK(!url_fetcher->GetStatus().is_io_pending()); |
| 362 | 362 |
| 363 *retry_after = base::TimeDelta(); | 363 *retry_after = base::TimeDelta(); |
| 364 | 364 |
| 365 // If there's a network error of some sort when fetching a file via HTTP, | 365 // If there's a network error of some sort when fetching a file via HTTP, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 | 414 |
| 415 bool CaptivePortalService::FetchingURL() const { | 415 bool CaptivePortalService::FetchingURL() const { |
| 416 return url_fetcher_.get() != NULL; | 416 return url_fetcher_.get() != NULL; |
| 417 } | 417 } |
| 418 | 418 |
| 419 bool CaptivePortalService::TimerRunning() const { | 419 bool CaptivePortalService::TimerRunning() const { |
| 420 return check_captive_portal_timer_.IsRunning(); | 420 return check_captive_portal_timer_.IsRunning(); |
| 421 } | 421 } |
| 422 | 422 |
| 423 } // namespace captive_portal | 423 } // namespace captive_portal |
| OLD | NEW |