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

Unified Diff: ash/system/network/network_icon.cc

Issue 2819303002: Changed wifi arcs to mobile bars for Tether network. (Closed)
Patch Set: Created 3 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: ash/system/network/network_icon.cc
diff --git a/ash/system/network/network_icon.cc b/ash/system/network/network_icon.cc
index 39eea46a6964d0a46b28c29af2753585a9434f28..00e5accf6cff10be18b9f49e2bdb22d97ff82d13 100644
--- a/ash/system/network/network_icon.cc
+++ b/ash/system/network/network_icon.cc
@@ -423,11 +423,19 @@ class SignalStrengthImageSource : public gfx::CanvasImageSource {
ImageType ImageTypeForNetworkType(const std::string& type) {
if (type == shill::kTypeWifi)
return ARCS;
- else if (type == shill::kTypeCellular || type == shill::kTypeWimax)
+ else if (type == shill::kTypeCellular || type == shill::kTypeWimax ||
+ type == chromeos::kTypeTether)
return BARS;
return NONE;
}
+ImageType ImageTypeForNetwork(const NetworkState* network) {
+ if (network->type() == shill::kTypeWifi && !network->tether_guid().empty())
Kyle Horimoto 2017/04/17 19:50:04 Add a comment explaining what this means.
lesliewatkins 2017/04/27 00:33:53 Done.
+ return ImageTypeForNetworkType(chromeos::kTypeTether);
+
+ return ImageTypeForNetworkType(network->type());
+}
+
gfx::ImageSkia GetImageForIndex(ImageType image_type,
IconType icon_type,
int index) {
@@ -542,7 +550,7 @@ gfx::ImageSkia GetIcon(const NetworkState* network,
GetDefaultColorForIconType(ICON_TYPE_LIST));
} else if (network->Matches(NetworkTypePattern::Wireless())) {
DCHECK(strength_index > 0);
- return GetImageForIndex(ImageTypeForNetworkType(network->type()), icon_type,
+ return GetImageForIndex(ImageTypeForNetwork(network), icon_type,
strength_index);
} else if (network->Matches(NetworkTypePattern::VPN())) {
DCHECK_NE(ICON_TYPE_TRAY, icon_type);
@@ -759,11 +767,17 @@ NetworkIconImpl* FindAndUpdateImageImpl(const NetworkState* network,
gfx::ImageSkia GetImageForNetwork(const NetworkState* network,
IconType icon_type) {
DCHECK(network);
+ std::string network_type = network->type();
+
if (!network->visible())
- return GetBasicImage(false, icon_type, network->type());
+ return GetBasicImage(false, icon_type, network_type);
Kyle Horimoto 2017/04/17 19:50:04 nit: Add /* parameter_name */ after "false" so tha
lesliewatkins 2017/04/27 00:33:53 Done.
+
+ if (!network->tether_guid().empty()) {
Kyle Horimoto 2017/04/17 19:50:03 Also add an explanatory comment here.
lesliewatkins 2017/04/27 00:33:53 Done.
+ network_type = chromeos::kTypeTether;
Kyle Horimoto 2017/04/17 19:50:03 You do this check in ImageTypeForNetwork as well.
lesliewatkins 2017/04/27 00:33:53 Done.
+ }
if (network->IsConnectingState())
- return GetConnectingImage(icon_type, network->type());
+ return GetConnectingImage(icon_type, network_type);
NetworkIconImpl* icon = FindAndUpdateImageImpl(network, icon_type);
return icon->image();

Powered by Google App Engine
This is Rietveld 408576698