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

Unified Diff: chrome/browser/chromeos/dom_ui/internet_options_handler.cc

Issue 3108011: If ethernet is not available (i.e. no wired nic), don't show ethernet in stat... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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/chromeos/dom_ui/internet_options_handler.cc
===================================================================
--- chrome/browser/chromeos/dom_ui/internet_options_handler.cc (revision 55422)
+++ chrome/browser/chromeos/dom_ui/internet_options_handler.cc (working copy)
@@ -225,21 +225,25 @@
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
ListValue* list = new ListValue();
- const chromeos::EthernetNetwork& ethernet_network = cros->ethernet_network();
- SkBitmap icon = *rb.GetBitmapNamed(IDR_STATUSBAR_WIRED_BLACK);
- if (!ethernet_network.connecting() &&
- !ethernet_network.connected()) {
- icon = chromeos::NetworkMenuButton::IconForDisplay(icon,
- *rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_DISCONNECTED));
+ // If ethernet is not enabled, then don't add anything.
+ if (cros->ethernet_enabled()) {
+ const chromeos::EthernetNetwork& ethernet_network =
+ cros->ethernet_network();
+ SkBitmap icon = *rb.GetBitmapNamed(IDR_STATUSBAR_WIRED_BLACK);
+ if (!ethernet_network.connecting() &&
+ !ethernet_network.connected()) {
+ icon = chromeos::NetworkMenuButton::IconForDisplay(icon,
+ *rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_DISCONNECTED));
+ }
+ list->Append(GetNetwork(
+ ethernet_network.service_path(),
+ icon,
+ l10n_util::GetStringUTF8(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET),
+ ethernet_network.connecting(),
+ ethernet_network.connected(),
+ chromeos::TYPE_ETHERNET,
+ false));
}
- list->Append(GetNetwork(
- ethernet_network.service_path(),
- icon,
- l10n_util::GetStringUTF8(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET),
- ethernet_network.connecting(),
- ethernet_network.connected(),
- chromeos::TYPE_ETHERNET,
- false));
return list;
}
@@ -286,14 +290,17 @@
false));
}
- list->Append(GetNetwork(
- kOtherNetworksFakePath,
- SkBitmap(),
- l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_OTHER_NETWORKS),
- false,
- false,
- chromeos::TYPE_WIFI,
- false));
+ // Add "Other..." if wifi is enabled.
+ if (cros->wifi_enabled()) {
+ list->Append(GetNetwork(
+ kOtherNetworksFakePath,
+ SkBitmap(),
+ l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_OTHER_NETWORKS),
+ false,
+ false,
+ chromeos::TYPE_WIFI,
+ false));
+ }
return list;
}

Powered by Google App Engine
This is Rietveld 408576698