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

Unified Diff: chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc

Issue 6899025: Show hardware addresses for wifi and ethernet networks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: z Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
index 4992dbc5720247b279084d3e41d4ee08c9dc96d9..86b7667b6b73ea3f9bfc67230206885ed337681e 100644
--- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
@@ -46,22 +46,6 @@
static const char kOtherNetworksFakePath[] = "?";
-namespace {
-
-// Format the hardware address like "0011AA22BB33" => "00:11:AA:22:BB:33".
-std::string FormatHardwareAddress(const std::string& address) {
- std::string output;
- for (size_t i = 0; i < address.size(); ++i) {
- if (i != 0 && i % 2 == 0) {
- output.push_back(':');
- }
- output.push_back(toupper(address[i]));
- }
- return output;
-}
-
-} // namespace
-
InternetOptionsHandler::InternetOptionsHandler()
: chromeos::CrosOptionsPageUIHandler(
new chromeos::UserCrosSettingsProvider),
@@ -593,12 +577,11 @@ void InternetOptionsHandler::PopulateDictionaryDetails(
DCHECK(net);
DictionaryValue dictionary;
std::string hardware_address;
- chromeos::NetworkIPConfigVector ipconfigs =
- cros->GetIPConfigs(net->device_path(), &hardware_address);
- if (!hardware_address.empty()) {
- dictionary.SetString("hardwareAddress",
- FormatHardwareAddress(hardware_address));
- }
+ chromeos::NetworkIPConfigVector ipconfigs = cros->GetIPConfigs(
+ net->device_path(), &hardware_address,
+ chromeos::NetworkLibrary::FORMAT_COLON_SEPARATED_HEX);
+ if (!hardware_address.empty())
+ dictionary.SetString("hardwareAddress", hardware_address);
scoped_ptr<ListValue> ipconfig_list(new ListValue());
for (chromeos::NetworkIPConfigVector::const_iterator it = ipconfigs.begin();
it != ipconfigs.end(); ++it) {
« chrome/app/generated_resources.grd ('K') | « chrome/browser/ui/views/about_ipc_dialog.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698