| 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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 | 540 |
| 541 // static | 541 // static |
| 542 NetworkChangeNotifier::ConnectionType | 542 NetworkChangeNotifier::ConnectionType |
| 543 NetworkChangeNotifier::GetConnectionType() { | 543 NetworkChangeNotifier::GetConnectionType() { |
| 544 return g_network_change_notifier ? | 544 return g_network_change_notifier ? |
| 545 g_network_change_notifier->GetCurrentConnectionType() : | 545 g_network_change_notifier->GetCurrentConnectionType() : |
| 546 CONNECTION_UNKNOWN; | 546 CONNECTION_UNKNOWN; |
| 547 } | 547 } |
| 548 | 548 |
| 549 // static | 549 // static |
| 550 std::string NetworkChangeNotifier::GetWiFiSSID() { |
| 551 return g_network_change_notifier |
| 552 ? g_network_change_notifier->GetCurrentWiFiSSID() |
| 553 : std::string(); |
| 554 } |
| 555 |
| 556 // static |
| 550 void NetworkChangeNotifier::GetMaxBandwidthAndConnectionType( | 557 void NetworkChangeNotifier::GetMaxBandwidthAndConnectionType( |
| 551 double* max_bandwidth_mbps, | 558 double* max_bandwidth_mbps, |
| 552 ConnectionType* connection_type) { | 559 ConnectionType* connection_type) { |
| 553 if (!g_network_change_notifier) { | 560 if (!g_network_change_notifier) { |
| 554 *connection_type = CONNECTION_UNKNOWN; | 561 *connection_type = CONNECTION_UNKNOWN; |
| 555 *max_bandwidth_mbps = GetMaxBandwidthForConnectionSubtype(SUBTYPE_UNKNOWN); | 562 *max_bandwidth_mbps = GetMaxBandwidthForConnectionSubtype(SUBTYPE_UNKNOWN); |
| 556 return; | 563 return; |
| 557 } | 564 } |
| 558 | 565 |
| 559 g_network_change_notifier->GetCurrentMaxBandwidthAndConnectionType( | 566 g_network_change_notifier->GetCurrentMaxBandwidthAndConnectionType( |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 // This default implementation conforms to the NetInfo V3 specification but | 998 // This default implementation conforms to the NetInfo V3 specification but |
| 992 // should be overridden to provide specific bandwidth data based on the | 999 // should be overridden to provide specific bandwidth data based on the |
| 993 // platform. | 1000 // platform. |
| 994 *connection_type = GetCurrentConnectionType(); | 1001 *connection_type = GetCurrentConnectionType(); |
| 995 *max_bandwidth_mbps = | 1002 *max_bandwidth_mbps = |
| 996 *connection_type == CONNECTION_NONE | 1003 *connection_type == CONNECTION_NONE |
| 997 ? GetMaxBandwidthForConnectionSubtype(SUBTYPE_NONE) | 1004 ? GetMaxBandwidthForConnectionSubtype(SUBTYPE_NONE) |
| 998 : GetMaxBandwidthForConnectionSubtype(SUBTYPE_UNKNOWN); | 1005 : GetMaxBandwidthForConnectionSubtype(SUBTYPE_UNKNOWN); |
| 999 } | 1006 } |
| 1000 | 1007 |
| 1008 std::string NetworkChangeNotifier::GetCurrentWiFiSSID() const { |
| 1009 return std::string(); |
| 1010 } |
| 1011 |
| 1001 bool NetworkChangeNotifier::AreNetworkHandlesCurrentlySupported() const { | 1012 bool NetworkChangeNotifier::AreNetworkHandlesCurrentlySupported() const { |
| 1002 return false; | 1013 return false; |
| 1003 } | 1014 } |
| 1004 | 1015 |
| 1005 void NetworkChangeNotifier::GetCurrentConnectedNetworks( | 1016 void NetworkChangeNotifier::GetCurrentConnectedNetworks( |
| 1006 NetworkList* network_list) const { | 1017 NetworkList* network_list) const { |
| 1007 network_list->clear(); | 1018 network_list->clear(); |
| 1008 } | 1019 } |
| 1009 | 1020 |
| 1010 NetworkChangeNotifier::ConnectionType | 1021 NetworkChangeNotifier::ConnectionType |
| (...skipping 158 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 |