Chromium Code Reviews| 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 "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/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 13 #include "chromeos/dbus/shill_stub_helper.h" | |
| 14 #include "chromeos/network/network_state.h" | 13 #include "chromeos/network/network_state.h" |
| 15 #include "chromeos/network/network_state_handler.h" | 14 #include "chromeos/network/network_state_handler.h" |
| 16 #include "content/public/browser/notification_service.h" | 15 #include "content/public/browser/notification_service.h" |
| 17 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
| 18 #include "net/http/http_status_code.h" | 17 #include "net/http/http_status_code.h" |
| 19 #include "third_party/cros_system_api/dbus/service_constants.h" | 18 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 21 | 20 |
| 22 using captive_portal::CaptivePortalDetector; | 21 using captive_portal::CaptivePortalDetector; |
| 23 | 22 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 355 captive_portal_detector_->Cancel(); | 354 captive_portal_detector_->Cancel(); |
| 356 detection_timeout_.Cancel(); | 355 detection_timeout_.Cancel(); |
| 357 state_ = STATE_IDLE; | 356 state_ = STATE_IDLE; |
| 358 } | 357 } |
| 359 | 358 |
| 360 void NetworkPortalDetectorImpl::OnPortalDetectionCompleted( | 359 void NetworkPortalDetectorImpl::OnPortalDetectionCompleted( |
| 361 const CaptivePortalDetector::Results& results) { | 360 const CaptivePortalDetector::Results& results) { |
| 362 captive_portal::Result result = results.result; | 361 captive_portal::Result result = results.result; |
| 363 int response_code = results.response_code; | 362 int response_code = results.response_code; |
| 364 | 363 |
| 365 if (shill_stub_helper::IsStubPortalledWifiEnabled(default_service_path_)) { | |
|
pneubeck (no reviews)
2014/02/28 09:37:59
are you sure?
I thought this was for triggering th
stevenjb
2014/02/28 17:43:06
If we need it again we should implement it better
| |
| 366 result = captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL; | |
| 367 response_code = 200; | |
| 368 } | |
| 369 | |
| 370 DCHECK(CalledOnValidThread()); | 364 DCHECK(CalledOnValidThread()); |
| 371 DCHECK(IsCheckingForPortal()); | 365 DCHECK(IsCheckingForPortal()); |
| 372 | 366 |
| 373 VLOG(1) << "Portal detection completed: " | 367 VLOG(1) << "Portal detection completed: " |
| 374 << "name=" << default_network_name_ << ", " | 368 << "name=" << default_network_name_ << ", " |
| 375 << "id=" << default_network_id_ << ", " | 369 << "id=" << default_network_id_ << ", " |
| 376 << "result=" | 370 << "result=" |
| 377 << CaptivePortalDetector::CaptivePortalResultToString(results.result) | 371 << CaptivePortalDetector::CaptivePortalResultToString(results.result) |
| 378 << ", " | 372 << ", " |
| 379 << "response_code=" << results.response_code; | 373 << "response_code=" << results.response_code; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 550 if (network->connection_state() != shill::kStateOnline) | 544 if (network->connection_state() != shill::kStateOnline) |
| 551 RecordDiscrepancyWithShill(network, status); | 545 RecordDiscrepancyWithShill(network, status); |
| 552 break; | 546 break; |
| 553 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT: | 547 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT: |
| 554 NOTREACHED(); | 548 NOTREACHED(); |
| 555 break; | 549 break; |
| 556 } | 550 } |
| 557 } | 551 } |
| 558 | 552 |
| 559 } // namespace chromeos | 553 } // namespace chromeos |
| OLD | NEW |