| 236 |
animation_connecting_.StartThrobbing(std::numeric_limits<int>::max()); |
animation_connecting_.StartThrobbing(std::numeric_limits<int>::max()); |
| 237 |
SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS1)); |
SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS1)); |
| 238 |
} |
} |
| 239 |
|
std::string network_name = cros->wifi_connecting() ? |
| 240 |
|
cros->wifi_name() : cros->cellular_name(); |
| 241 |
|
SetTooltipText( |
| 242 |
|
l10n_util::GetStringF(IDS_STATUSBAR_NETWORK_CONNECTING_TOOLTIP, |
| 243 |
|
UTF8ToWide(network_name))); |
| 244 |
} else { |
} else { |
| 245 |
// Stop connecting animation since we are not connecting. |
// Stop connecting animation since we are not connecting. |
| 246 |
animation_connecting_.Stop(); |
animation_connecting_.Stop(); |
| 247 |
|
|
| 248 |
// Always show the higher priority connection first. Ethernet then wifi. |
// Always show the higher priority connection first. Ethernet then wifi. |
| 249 |
if (cros->ethernet_connected()) |
if (cros->ethernet_connected()) { |
| 250 |
SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_WIRED)); |
SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_WIRED)); |
| 251 |
else if (cros->wifi_connected()) |
SetTooltipText( |
| 252 |
|
l10n_util::GetStringF( |
| 253 |
|
IDS_STATUSBAR_NETWORK_CONNECTED_TOOLTIP, |
| 254 |
|
l10n_util::GetString(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET))); |
| 255 |
|
} else if (cros->wifi_connected()) { |
| 256 |
SetIcon(IconForNetworkStrength(cros->wifi_strength(), false)); |
SetIcon(IconForNetworkStrength(cros->wifi_strength(), false)); |
| 257 |
else if (cros->cellular_connected()) |
SetTooltipText(l10n_util::GetStringF( |
| 258 |
|
IDS_STATUSBAR_NETWORK_CONNECTED_TOOLTIP, |
| 259 |
|
UTF8ToWide(cros->wifi_name()))); |
| 260 |
|
} else if (cros->cellular_connected()) { |
| 261 |
SetIcon(IconForNetworkStrength(cros->cellular_strength(), false)); |
SetIcon(IconForNetworkStrength(cros->cellular_strength(), false)); |
| 262 |
else |
SetTooltipText(l10n_util::GetStringF( |
| 263 |
|
IDS_STATUSBAR_NETWORK_CONNECTED_TOOLTIP, |
| 264 |
|
UTF8ToWide(cros->cellular_name()))); |
| 265 |
|
} else { |
| 266 |
SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0)); |
SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0)); |
| 267 |
|
SetTooltipText(l10n_util::GetString( |
| 268 |
|
IDS_STATUSBAR_NETWORK_NO_NETWORK_TOOLTIP)); |
| 269 |
|
} |
| 270 |
} |
} |
| 271 |
|
|
| 272 |
if (!cros->Connected() && !cros->Connecting()) { |
if (!cros->Connected() && !cros->Connecting()) { |
| 282 |
} else { |
} else { |
| 283 |
SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0)); |
SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0)); |
| 284 |
SetBadge(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_WARNING)); |
SetBadge(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_WARNING)); |
| 285 |
|
SetTooltipText(l10n_util::GetString( |
| 286 |
|
IDS_STATUSBAR_NETWORK_NO_NETWORK_TOOLTIP)); |
| 287 |
} |
} |
| 288 |
|
|
| 289 |
SchedulePaint(); |
SchedulePaint(); |