Index: chrome/browser/chromeos/cros/network_library.cc |
=================================================================== |
--- chrome/browser/chromeos/cros/network_library.cc (revision 39463) |
+++ chrome/browser/chromeos/cros/network_library.cc (working copy) |
@@ -387,4 +387,15 @@ |
return ethernet_connected() || wifi_connected() || cellular_connected(); |
} |
+const std::string& NetworkLibrary::IPAddress() const { |
+ // Returns highest priority IP address. |
+ if (ethernet_connected()) |
+ return ethernet_.ip_address; |
+ if (wifi_connected()) |
+ return wifi_.ip_address; |
+ if (cellular_connected()) |
+ return cellular_.ip_address; |
+ return ethernet_.ip_address; |
+} |
+ |
} // namespace chromeos |