Index: chromeos/network/network_state_handler.cc |
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc |
index 106537f0efa4c72554335ba0877941bae187cfb7..7a350acd7cb23e85b88438e1647def2135f31a47 100644 |
--- a/chromeos/network/network_state_handler.cc |
+++ b/chromeos/network/network_state_handler.cc |
@@ -277,6 +277,11 @@ std::string NetworkStateHandler::FormattedHardwareAddressForType( |
} |
void NetworkStateHandler::GetNetworkList(NetworkStateList* list) const { |
+ GetNetworkListByType(kMatchTypeDefault, list); |
+} |
+ |
+void NetworkStateHandler::GetNetworkListByType(const std::string& type, |
+ NetworkStateList* list) const { |
DCHECK(list); |
list->clear(); |
for (ManagedStateList::const_iterator iter = network_list_.begin(); |
@@ -285,7 +290,8 @@ void NetworkStateHandler::GetNetworkList(NetworkStateList* list) const { |
continue; |
const NetworkState* network = (*iter)->AsNetworkState(); |
DCHECK(network); |
- list->push_back(network); |
+ if (ManagedStateMatchesType(network, type)) |
+ list->push_back(network); |
} |
} |