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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 std::string NetworkStateHandler::FormattedHardwareAddressForType( | 253 std::string NetworkStateHandler::FormattedHardwareAddressForType( |
254 const NetworkTypePattern& type) const { | 254 const NetworkTypePattern& type) const { |
255 const DeviceState* device = NULL; | 255 const DeviceState* device = NULL; |
256 const NetworkState* network = ConnectedNetworkByType(type); | 256 const NetworkState* network = ConnectedNetworkByType(type); |
257 if (network) | 257 if (network) |
258 device = GetDeviceState(network->device_path()); | 258 device = GetDeviceState(network->device_path()); |
259 else | 259 else |
260 device = GetDeviceStateByType(type); | 260 device = GetDeviceStateByType(type); |
261 if (!device) | 261 if (!device) |
262 return std::string(); | 262 return std::string(); |
263 return device->GetFormattedMacAddress(); | 263 return network_util::FormattedMacAddress(device->mac_address()); |
264 } | 264 } |
265 | 265 |
266 void NetworkStateHandler::GetNetworkList(NetworkStateList* list) const { | 266 void NetworkStateHandler::GetNetworkList(NetworkStateList* list) const { |
267 GetNetworkListByType(NetworkTypePattern::Default(), list); | 267 GetNetworkListByType(NetworkTypePattern::Default(), list); |
268 } | 268 } |
269 | 269 |
270 void NetworkStateHandler::GetNetworkListByType(const NetworkTypePattern& type, | 270 void NetworkStateHandler::GetNetworkListByType(const NetworkTypePattern& type, |
271 NetworkStateList* list) const { | 271 NetworkStateList* list) const { |
272 DCHECK(list); | 272 DCHECK(list); |
273 list->clear(); | 273 list->clear(); |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 if (type.MatchesType(shill::kTypeBluetooth)) | 954 if (type.MatchesType(shill::kTypeBluetooth)) |
955 technologies.push_back(new std::string(shill::kTypeBluetooth)); | 955 technologies.push_back(new std::string(shill::kTypeBluetooth)); |
956 if (type.MatchesType(shill::kTypeVPN)) | 956 if (type.MatchesType(shill::kTypeVPN)) |
957 technologies.push_back(new std::string(shill::kTypeVPN)); | 957 technologies.push_back(new std::string(shill::kTypeVPN)); |
958 | 958 |
959 CHECK_GT(technologies.size(), 0ul); | 959 CHECK_GT(technologies.size(), 0ul); |
960 return technologies.Pass(); | 960 return technologies.Pass(); |
961 } | 961 } |
962 | 962 |
963 } // namespace chromeos | 963 } // namespace chromeos |
OLD | NEW |