| 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 case CONNECTION_NONE: | 790 case CONNECTION_NONE: |
| 791 case CONNECTION_BLUETOOTH: | 791 case CONNECTION_BLUETOOTH: |
| 792 is_cellular = false; | 792 is_cellular = false; |
| 793 break; | 793 break; |
| 794 } | 794 } |
| 795 return is_cellular; | 795 return is_cellular; |
| 796 } | 796 } |
| 797 | 797 |
| 798 // static | 798 // static |
| 799 NetworkChangeNotifier::ConnectionType | 799 NetworkChangeNotifier::ConnectionType |
| 800 NetworkChangeNotifier::ConnectionTypeFromInterfaces() { |
| 801 NetworkInterfaceList interfaces; |
| 802 if (!GetNetworkList(&interfaces, EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES)) |
| 803 return CONNECTION_UNKNOWN; |
| 804 return ConnectionTypeFromInterfaceList(interfaces); |
| 805 } |
| 806 |
| 807 // static |
| 808 NetworkChangeNotifier::ConnectionType |
| 800 NetworkChangeNotifier::ConnectionTypeFromInterfaceList( | 809 NetworkChangeNotifier::ConnectionTypeFromInterfaceList( |
| 801 const NetworkInterfaceList& interfaces) { | 810 const NetworkInterfaceList& interfaces) { |
| 802 bool first = true; | 811 bool first = true; |
| 803 ConnectionType result = CONNECTION_NONE; | 812 ConnectionType result = CONNECTION_NONE; |
| 804 for (size_t i = 0; i < interfaces.size(); ++i) { | 813 for (size_t i = 0; i < interfaces.size(); ++i) { |
| 805 #if defined(OS_WIN) | 814 #if defined(OS_WIN) |
| 806 if (interfaces[i].friendly_name == "Teredo Tunneling Pseudo-Interface") | 815 if (interfaces[i].friendly_name == "Teredo Tunneling Pseudo-Interface") |
| 807 continue; | 816 continue; |
| 808 #endif | 817 #endif |
| 809 // Remove VMware network interfaces as they're internal and should not be | 818 // Remove VMware network interfaces as they're internal and should not be |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 | 1197 |
| 1189 NetworkChangeNotifier::DisableForTest::~DisableForTest() { | 1198 NetworkChangeNotifier::DisableForTest::~DisableForTest() { |
| 1190 DCHECK(!g_network_change_notifier); | 1199 DCHECK(!g_network_change_notifier); |
| 1191 g_network_change_notifier = network_change_notifier_; | 1200 g_network_change_notifier = network_change_notifier_; |
| 1192 } | 1201 } |
| 1193 | 1202 |
| 1194 void NetworkChangeNotifier::DNSObserver::OnInitialDNSConfigRead() { | 1203 void NetworkChangeNotifier::DNSObserver::OnInitialDNSConfigRead() { |
| 1195 } | 1204 } |
| 1196 | 1205 |
| 1197 } // namespace net | 1206 } // namespace net |
| OLD | NEW |