| Index: net/base/network_change_notifier.cc
|
| diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
|
| index c55be07d731178ceaf85a013c936bc4f7180ec08..3f776bdcd35ed0669919a5c0a56958318c90f1e1 100644
|
| --- a/net/base/network_change_notifier.cc
|
| +++ b/net/base/network_change_notifier.cc
|
| @@ -763,6 +763,36 @@ void NetworkChangeNotifier::SetDnsConfig(const DnsConfig& config) {
|
| NotifyObserversOfDNSChange();
|
| }
|
|
|
| +// static
|
| +NetworkChangeNotifier::ConnectionType
|
| +NetworkChangeNotifier::ConnectionTypeFromInterfaces() {
|
| + NetworkInterfaceList interfaces;
|
| + if (!GetNetworkList(&interfaces, EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES))
|
| + return CONNECTION_UNKNOWN;
|
| + return ConnectionTypeFromInterfaceList(interfaces);
|
| +}
|
| +
|
| +//static
|
| +NetworkChangeNotifier::ConnectionType
|
| +NetworkChangeNotifier::ConnectionTypeFromInterfaceList(
|
| + const NetworkInterfaceList& interfaces) {
|
| + bool first = true;
|
| + ConnectionType result = CONNECTION_UNKNOWN;
|
| + for (size_t i = 0; i < interfaces.size(); ++i) {
|
| +#if defined(OS_WIN)
|
| + if (interfaces[i].friendly_name == "Teredo Tunneling Pseudo-Interface")
|
| + continue;
|
| +#endif
|
| + if (first) {
|
| + first = false;
|
| + result = interfaces[i].type;
|
| + } else if (result != interfaces[i].type) {
|
| + return CONNECTION_UNKNOWN;
|
| + }
|
| + }
|
| + return result;
|
| +}
|
| +
|
| void NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange() {
|
| if (g_network_change_notifier) {
|
| g_network_change_notifier->connection_type_observer_list_->Notify(
|
|
|