OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/net/network_portal_detector_impl.h" | 5 #include "chrome/browser/chromeos/net/network_portal_detector_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 << "id=" << default_network_id_; | 384 << "id=" << default_network_id_; |
385 | 385 |
386 captive_portal_detector_->Cancel(); | 386 captive_portal_detector_->Cancel(); |
387 CaptivePortalDetector::Results results; | 387 CaptivePortalDetector::Results results; |
388 results.result = captive_portal::RESULT_NO_RESPONSE; | 388 results.result = captive_portal::RESULT_NO_RESPONSE; |
389 OnAttemptCompleted(results); | 389 OnAttemptCompleted(results); |
390 } | 390 } |
391 | 391 |
392 void NetworkPortalDetectorImpl::OnAttemptCompleted( | 392 void NetworkPortalDetectorImpl::OnAttemptCompleted( |
393 const CaptivePortalDetector::Results& results) { | 393 const CaptivePortalDetector::Results& results) { |
394 captive_portal::Result result = results.result; | 394 captive_portal::CaptivePortalResult result = results.result; |
395 int response_code = results.response_code; | 395 int response_code = results.response_code; |
396 | 396 |
397 DCHECK(CalledOnValidThread()); | 397 DCHECK(CalledOnValidThread()); |
398 DCHECK(is_checking_for_portal()); | 398 DCHECK(is_checking_for_portal()); |
399 | 399 |
400 VLOG(1) << "Detection attempt completed: " | 400 VLOG(1) << "Detection attempt completed: " |
401 << "name=" << default_network_name_ << ", " | 401 << "name=" << default_network_name_ << ", " |
402 << "id=" << default_network_id_ << ", " | 402 << "id=" << default_network_id_ << ", " |
403 << "result=" | 403 << "result=" |
404 << CaptivePortalDetector::CaptivePortalResultToString(results.result) | 404 << captive_portal::CaptivePortalResultToString(results.result) |
405 << ", " | 405 << ", " |
406 << "response_code=" << results.response_code; | 406 << "response_code=" << results.response_code; |
407 | 407 |
408 state_ = STATE_IDLE; | 408 state_ = STATE_IDLE; |
409 attempt_timeout_.Cancel(); | 409 attempt_timeout_.Cancel(); |
410 ++attempt_count_; | 410 ++attempt_count_; |
411 | 411 |
412 const NetworkState* network = DefaultNetwork(); | 412 const NetworkState* network = DefaultNetwork(); |
413 | 413 |
414 // If using a fake profile client, also fake being behind a captive portal | 414 // If using a fake profile client, also fake being behind a captive portal |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 PortalDetectorStrategy::StrategyId id) { | 577 PortalDetectorStrategy::StrategyId id) { |
578 if (id == strategy_->Id()) | 578 if (id == strategy_->Id()) |
579 return; | 579 return; |
580 strategy_.reset(PortalDetectorStrategy::CreateById(id).release()); | 580 strategy_.reset(PortalDetectorStrategy::CreateById(id).release()); |
581 strategy_->set_delegate(this); | 581 strategy_->set_delegate(this); |
582 StopDetection(); | 582 StopDetection(); |
583 StartDetectionIfIdle(); | 583 StartDetectionIfIdle(); |
584 } | 584 } |
585 | 585 |
586 } // namespace chromeos | 586 } // namespace chromeos |
OLD | NEW |