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

Unified Diff: chromeos/network/network_state_handler.cc

Issue 61183002: Get device by type for Hardware Address (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state_handler.cc
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc
index 8bb79e28c09c1d22df34725064501de2a65f05c2..e5dd1f4d407020e2d22462039883866a54897880 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -247,10 +247,12 @@ const NetworkState* NetworkStateHandler::FirstNetworkByType(
std::string NetworkStateHandler::HardwareAddressForType(
const NetworkTypePattern& type) const {
+ const DeviceState* device = NULL;
const NetworkState* network = ConnectedNetworkByType(type);
- if (!network)
- return std::string();
- const DeviceState* device = GetDeviceState(network->device_path());
+ if (network)
+ device = GetDeviceState(network->device_path());
+ else
+ device = GetDeviceStateByType(type);
if (!device)
return std::string();
std::string result = device->mac_address();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698