| 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 "net/base/network_change_notifier.h" | 5 #include "net/base/network_change_notifier.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <unordered_set> | 8 #include <unordered_set> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 // static | 666 // static |
| 667 NetworkChangeNotifier::NetworkHandle | 667 NetworkChangeNotifier::NetworkHandle |
| 668 NetworkChangeNotifier::GetDefaultNetwork() { | 668 NetworkChangeNotifier::GetDefaultNetwork() { |
| 669 DCHECK(AreNetworkHandlesSupported()); | 669 DCHECK(AreNetworkHandlesSupported()); |
| 670 return g_network_change_notifier | 670 return g_network_change_notifier |
| 671 ? g_network_change_notifier->GetCurrentDefaultNetwork() | 671 ? g_network_change_notifier->GetCurrentDefaultNetwork() |
| 672 : kInvalidNetworkHandle; | 672 : kInvalidNetworkHandle; |
| 673 } | 673 } |
| 674 | 674 |
| 675 // static | 675 // static |
| 676 bool NetworkChangeNotifier::GetNetworkCaptivePortal() { |
| 677 return g_network_change_notifier |
| 678 ? g_network_change_notifier->GetCurrentNetworkCaptivePortal() |
| 679 : false; |
| 680 } |
| 681 |
| 682 // static |
| 676 void NetworkChangeNotifier::GetDnsConfig(DnsConfig* config) { | 683 void NetworkChangeNotifier::GetDnsConfig(DnsConfig* config) { |
| 677 if (!g_network_change_notifier) { | 684 if (!g_network_change_notifier) { |
| 678 *config = DnsConfig(); | 685 *config = DnsConfig(); |
| 679 } else { | 686 } else { |
| 680 g_network_change_notifier->network_state_->GetDnsConfig(config); | 687 g_network_change_notifier->network_state_->GetDnsConfig(config); |
| 681 } | 688 } |
| 682 } | 689 } |
| 683 | 690 |
| 684 // static | 691 // static |
| 685 const char* NetworkChangeNotifier::ConnectionTypeToString( | 692 const char* NetworkChangeNotifier::ConnectionTypeToString( |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 NetworkChangeNotifier::GetCurrentNetworkConnectionType( | 1018 NetworkChangeNotifier::GetCurrentNetworkConnectionType( |
| 1012 NetworkHandle network) const { | 1019 NetworkHandle network) const { |
| 1013 return CONNECTION_UNKNOWN; | 1020 return CONNECTION_UNKNOWN; |
| 1014 } | 1021 } |
| 1015 | 1022 |
| 1016 NetworkChangeNotifier::NetworkHandle | 1023 NetworkChangeNotifier::NetworkHandle |
| 1017 NetworkChangeNotifier::GetCurrentDefaultNetwork() const { | 1024 NetworkChangeNotifier::GetCurrentDefaultNetwork() const { |
| 1018 return kInvalidNetworkHandle; | 1025 return kInvalidNetworkHandle; |
| 1019 } | 1026 } |
| 1020 | 1027 |
| 1028 bool NetworkChangeNotifier::GetCurrentNetworkCaptivePortal() const { |
| 1029 return false; |
| 1030 } |
| 1031 |
| 1021 // static | 1032 // static |
| 1022 void NetworkChangeNotifier::NotifyObserversOfIPAddressChange() { | 1033 void NetworkChangeNotifier::NotifyObserversOfIPAddressChange() { |
| 1023 if (g_network_change_notifier && | 1034 if (g_network_change_notifier && |
| 1024 !NetworkChangeNotifier::test_notifications_only_) { | 1035 !NetworkChangeNotifier::test_notifications_only_) { |
| 1025 g_network_change_notifier->NotifyObserversOfIPAddressChangeImpl(); | 1036 g_network_change_notifier->NotifyObserversOfIPAddressChangeImpl(); |
| 1026 } | 1037 } |
| 1027 } | 1038 } |
| 1028 | 1039 |
| 1029 // static | 1040 // static |
| 1030 void NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange() { | 1041 void NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange() { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 | 1180 |
| 1170 NetworkChangeNotifier::DisableForTest::~DisableForTest() { | 1181 NetworkChangeNotifier::DisableForTest::~DisableForTest() { |
| 1171 DCHECK(!g_network_change_notifier); | 1182 DCHECK(!g_network_change_notifier); |
| 1172 g_network_change_notifier = network_change_notifier_; | 1183 g_network_change_notifier = network_change_notifier_; |
| 1173 } | 1184 } |
| 1174 | 1185 |
| 1175 void NetworkChangeNotifier::DNSObserver::OnInitialDNSConfigRead() { | 1186 void NetworkChangeNotifier::DNSObserver::OnInitialDNSConfigRead() { |
| 1176 } | 1187 } |
| 1177 | 1188 |
| 1178 } // namespace net | 1189 } // namespace net |
| OLD | NEW |