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 "chromeos/network/network_state_handler.h" | 5 #include "chromeos/network/network_state_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 const NetworkState* NetworkStateHandler::FirstNetworkByType( | 216 const NetworkState* NetworkStateHandler::FirstNetworkByType( |
217 const NetworkTypePattern& type) const { | 217 const NetworkTypePattern& type) const { |
218 for (ManagedStateList::const_iterator iter = network_list_.begin(); | 218 for (ManagedStateList::const_iterator iter = network_list_.begin(); |
219 iter != network_list_.end(); ++iter) { | 219 iter != network_list_.end(); ++iter) { |
220 const NetworkState* network = (*iter)->AsNetworkState(); | 220 const NetworkState* network = (*iter)->AsNetworkState(); |
221 DCHECK(network); | 221 DCHECK(network); |
222 if (!network->update_received()) | 222 if (!network->update_received()) |
223 continue; | 223 continue; |
224 if (!network->visible()) | 224 if (!network->visible()) |
225 break; | 225 continue; |
226 if (network->Matches(type)) | 226 if (network->Matches(type)) |
227 return network; | 227 return network; |
228 } | 228 } |
229 return NULL; | 229 return NULL; |
230 } | 230 } |
231 | 231 |
232 std::string NetworkStateHandler::FormattedHardwareAddressForType( | 232 std::string NetworkStateHandler::FormattedHardwareAddressForType( |
233 const NetworkTypePattern& type) const { | 233 const NetworkTypePattern& type) const { |
234 const DeviceState* device = NULL; | 234 const DeviceState* device = NULL; |
235 const NetworkState* network = ConnectedNetworkByType(type); | 235 const NetworkState* network = ConnectedNetworkByType(type); |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 if (type.MatchesType(shill::kTypeBluetooth)) | 910 if (type.MatchesType(shill::kTypeBluetooth)) |
911 technologies.push_back(new std::string(shill::kTypeBluetooth)); | 911 technologies.push_back(new std::string(shill::kTypeBluetooth)); |
912 if (type.MatchesType(shill::kTypeVPN)) | 912 if (type.MatchesType(shill::kTypeVPN)) |
913 technologies.push_back(new std::string(shill::kTypeVPN)); | 913 technologies.push_back(new std::string(shill::kTypeVPN)); |
914 | 914 |
915 CHECK_GT(technologies.size(), 0ul); | 915 CHECK_GT(technologies.size(), 0ul); |
916 return technologies.Pass(); | 916 return technologies.Pass(); |
917 } | 917 } |
918 | 918 |
919 } // namespace chromeos | 919 } // namespace chromeos |
OLD | NEW |