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

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

Issue 2843383004: CrOS: Right align captive portal/"controlled by extension" network icon (Closed)
Patch Set: fix layout 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
« no previous file with comments | « no previous file | ash/system/tray/fixed_sized_image_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/network/network_state_list_detailed_view.cc
diff --git a/ash/system/network/network_state_list_detailed_view.cc b/ash/system/network/network_state_list_detailed_view.cc
index 9a01efeb69c4e17747796319445a64fb0442dbdf..64d6c446f4e497f7dcf84cc9139bd451e504b110 100644
--- a/ash/system/network/network_state_list_detailed_view.cc
+++ b/ash/system/network/network_state_list_detailed_view.cc
@@ -33,6 +33,7 @@
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_details_view.h"
#include "ash/system/tray/tray_popup_header_button.h"
+#include "ash/system/tray/tray_popup_utils.h"
#include "ash/system/tray/tri_view.h"
#include "ash/wm_window.h"
#include "base/command_line.h"
@@ -457,17 +458,12 @@ views::View* NetworkStateListDetailedView::CreateControlledByExtensionView(
if (!extension_info)
return nullptr;
- // Get the tooltip text.
- base::string16 tooltip_text = l10n_util::GetStringFUTF16(
- IDS_ASH_STATUS_TRAY_EXTENSION_CONTROLLED_WIFI,
- base::UTF8ToUTF16(extension_info->extension_name));
-
- views::ImageView* controlled_icon =
- new FixedSizedImageView(kTrayPopupDetailsIconWidth, 0);
tdanderson 2017/05/01 15:31:16 Can you please rebase and then re-ping? It looks l
-
+ views::ImageView* controlled_icon = TrayPopupUtils::CreateMainImageView();
controlled_icon->SetImage(
gfx::CreateVectorIcon(kCaptivePortalIcon, kMenuIconColor));
- controlled_icon->SetTooltipText(tooltip_text);
+ controlled_icon->SetTooltipText(l10n_util::GetStringFUTF16(
+ IDS_ASH_STATUS_TRAY_EXTENSION_CONTROLLED_WIFI,
+ base::UTF8ToUTF16(extension_info->extension_name)));
return controlled_icon;
}
@@ -484,16 +480,7 @@ void NetworkStateListDetailedView::CallRequestScan() {
views::View* NetworkStateListDetailedView::CreateViewForNetwork(
const NetworkInfo& info) {
HoverHighlightView* container = new HoverHighlightView(this);
- if (info.connected)
- SetupConnectedItem(container, info.label, info.image);
- else if (info.connecting)
- SetupConnectingItem(container, info.label, info.image);
- else
- container->AddIconAndLabel(info.image, info.label);
- container->SetTooltipText(info.tooltip);
- views::View* controlled_icon = CreateControlledByExtensionView(info);
- if (controlled_icon)
- container->AddChildView(controlled_icon);
+ UpdateViewForNetwork(container, info);
return container;
}
@@ -516,7 +503,7 @@ void NetworkStateListDetailedView::UpdateViewForNetwork(
views::View* controlled_icon = CreateControlledByExtensionView(info);
container->SetTooltipText(info.tooltip);
if (controlled_icon)
- view->AddChildView(controlled_icon);
+ container->AddRightView(controlled_icon);
}
views::Label* NetworkStateListDetailedView::CreateInfoLabel() {
« no previous file with comments | « no previous file | ash/system/tray/fixed_sized_image_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698