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

Unified Diff: ash/system/chromeos/network/network_state_list_detailed_view.cc

Issue 1417853002: Add IPv6 Address to status tray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « ash/ash_chromeos_strings.grdp ('k') | chromeos/network/device_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/network/network_state_list_detailed_view.cc
diff --git a/ash/system/chromeos/network/network_state_list_detailed_view.cc b/ash/system/chromeos/network/network_state_list_detailed_view.cc
index d6a11df10ea2496199b297493ed4293ae18541d4..858690d316d9df4e8a17f56640625baa616ec6b8 100644
--- a/ash/system/chromeos/network/network_state_list_detailed_view.cc
+++ b/ash/system/chromeos/network/network_state_list_detailed_view.cc
@@ -644,10 +644,15 @@ views::View* NetworkStateListDetailedView::CreateNetworkInfoView() {
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
- std::string ip_address("0.0.0.0");
+ std::string ip_address, ipv6_address;
const NetworkState* network = handler->DefaultNetwork();
- if (network)
- ip_address = network->ip_address();
+ if (network) {
+ const DeviceState* device = handler->GetDeviceState(network->device_path());
+ if (device) {
+ ip_address = device->GetIpAddressByType(shill::kTypeIPv4);
+ ipv6_address = device->GetIpAddressByType(shill::kTypeIPv6);
+ }
+ }
views::View* container = new views::View;
container->SetLayoutManager(
@@ -669,6 +674,10 @@ views::View* NetworkStateListDetailedView::CreateNetworkInfoView() {
container->AddChildView(CreateInfoBubbleLine(
bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_IP), ip_address));
}
+ if (!ipv6_address.empty()) {
+ container->AddChildView(CreateInfoBubbleLine(
+ bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_IPV6), ipv6_address));
+ }
if (!ethernet_address.empty()) {
container->AddChildView(CreateInfoBubbleLine(
bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_ETHERNET),
« no previous file with comments | « ash/ash_chromeos_strings.grdp ('k') | chromeos/network/device_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698