Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: chromeos/network/network_state_handler.cc

Issue 285233008: Add MacAddress to ONC and networkingPrivate (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chromeos/network/managed_network_configuration_handler_impl.cc ('k') | chromeos/network/network_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698