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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 325 |
326 void NetworkPortalDetectorImpl::SetStrategy( | 326 void NetworkPortalDetectorImpl::SetStrategy( |
327 PortalDetectorStrategy::StrategyId id) { | 327 PortalDetectorStrategy::StrategyId id) { |
328 if (id == strategy_->Id()) | 328 if (id == strategy_->Id()) |
329 return; | 329 return; |
330 strategy_ = PortalDetectorStrategy::CreateById(id, this).Pass(); | 330 strategy_ = PortalDetectorStrategy::CreateById(id, this).Pass(); |
331 StopDetection(); | 331 StopDetection(); |
332 StartDetectionIfIdle(); | 332 StartDetectionIfIdle(); |
333 } | 333 } |
334 | 334 |
| 335 void NetworkPortalDetectorImpl::OnLockScreenRequest() { |
| 336 notification_controller_.CloseDialog(); |
| 337 } |
| 338 |
335 void NetworkPortalDetectorImpl::DefaultNetworkChanged( | 339 void NetworkPortalDetectorImpl::DefaultNetworkChanged( |
336 const NetworkState* default_network) { | 340 const NetworkState* default_network) { |
337 DCHECK(CalledOnValidThread()); | 341 DCHECK(CalledOnValidThread()); |
338 | 342 |
339 notification_controller_.DefaultNetworkChanged(default_network); | 343 notification_controller_.DefaultNetworkChanged(default_network); |
340 if (!default_network) { | 344 if (!default_network) { |
341 NET_LOG(EVENT) << "Default network changed: None"; | 345 NET_LOG(EVENT) << "Default network changed: None"; |
342 | 346 |
343 default_network_name_.clear(); | 347 default_network_name_.clear(); |
344 | 348 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 } | 644 } |
641 | 645 |
642 void NetworkPortalDetectorImpl::ResetStrategyAndCounters() { | 646 void NetworkPortalDetectorImpl::ResetStrategyAndCounters() { |
643 last_detection_result_ = CAPTIVE_PORTAL_STATUS_UNKNOWN; | 647 last_detection_result_ = CAPTIVE_PORTAL_STATUS_UNKNOWN; |
644 same_detection_result_count_ = 0; | 648 same_detection_result_count_ = 0; |
645 no_response_result_count_ = 0; | 649 no_response_result_count_ = 0; |
646 strategy_->Reset(); | 650 strategy_->Reset(); |
647 } | 651 } |
648 | 652 |
649 } // namespace chromeos | 653 } // namespace chromeos |
OLD | NEW |