Change connection warning text for managed proxy/DNS with identifiers
If the device is configured to use a proxy, VPN or DNS with identifiers, a warning is shown in the system tray to inform the user that the network may be monitored. If the proxy or DNS with identifiers are configured by the admin via a policy, this CL changes the text shown in the system tray to a different wording, which implies a lower privacy risk, from "Network may be monitored" to "Network is managed". go/cros-dohidentifiers-ux Bug: b/243905143 Change-Id: Ibaea96aafe1004866b9195e26f5a639dda0e06c0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4094422 Commit-Queue: Andreea Costinas <acostinas@google.com> Reviewed-by: Chad Duffin <chadduffin@chromium.org> Cr-Commit-Position: refs/heads/main@{#1083002}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
1a7225665d
commit
aa3a06726a
@@ -2936,6 +2936,9 @@ Connect your device to power.
|
|||||||
<message name="IDS_ASH_STATUS_TRAY_NETWORK_MONITORED_WARNING" desc="The label used in the tray popup to warn users their network may be monitored." >
|
<message name="IDS_ASH_STATUS_TRAY_NETWORK_MONITORED_WARNING" desc="The label used in the tray popup to warn users their network may be monitored." >
|
||||||
Network may be monitored
|
Network may be monitored
|
||||||
</message>
|
</message>
|
||||||
|
<message name="IDS_ASH_STATUS_TRAY_NETWORK_MANAGED_WARNING" desc="The label used in the tray popup to warn users their network is managed by an admin." >
|
||||||
|
Network is managed
|
||||||
|
</message>
|
||||||
<message name="IDS_ASH_A11Y_ROLE_BUTTON" desc="The label used to identify a button. For accessibility only." >
|
<message name="IDS_ASH_A11Y_ROLE_BUTTON" desc="The label used to identify a button. For accessibility only." >
|
||||||
Button
|
Button
|
||||||
</message>
|
</message>
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
bb9f516067ad04ec5da5c4fb718992955356f430
|
@@ -423,6 +423,11 @@ void NetworkListViewControllerImpl::OnGetManagedPropertiesResult(
|
|||||||
|
|
||||||
if (setManagedIcon) {
|
if (setManagedIcon) {
|
||||||
SetConnectionWarningIcon(connection_warning_, /*use_managed_icon=*/true);
|
SetConnectionWarningIcon(connection_warning_, /*use_managed_icon=*/true);
|
||||||
|
if (!is_vpn_managed_.value()) {
|
||||||
|
// Managed proxies are considered a lower privacy risk.
|
||||||
|
connection_warning_label_->SetText(l10n_util::GetStringUTF16(
|
||||||
|
IDS_ASH_STATUS_TRAY_NETWORK_MANAGED_WARNING));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -822,8 +827,9 @@ void NetworkListViewControllerImpl::ShowConnectionWarning(
|
|||||||
// Set message label in middle of row.
|
// Set message label in middle of row.
|
||||||
std::unique_ptr<views::Label> label =
|
std::unique_ptr<views::Label> label =
|
||||||
base::WrapUnique(TrayPopupUtils::CreateDefaultLabel());
|
base::WrapUnique(TrayPopupUtils::CreateDefaultLabel());
|
||||||
label->SetText(
|
label->SetText(l10n_util::GetStringUTF16(
|
||||||
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_MONITORED_WARNING));
|
show_managed_icon ? IDS_ASH_STATUS_TRAY_NETWORK_MANAGED_WARNING
|
||||||
|
: IDS_ASH_STATUS_TRAY_NETWORK_MONITORED_WARNING));
|
||||||
label->SetBackground(views::CreateSolidBackground(SK_ColorTRANSPARENT));
|
label->SetBackground(views::CreateSolidBackground(SK_ColorTRANSPARENT));
|
||||||
label->SetEnabledColor(AshColorProvider::Get()->GetContentLayerColor(
|
label->SetEnabledColor(AshColorProvider::Get()->GetContentLayerColor(
|
||||||
AshColorProvider::ContentLayerType::kTextColorPrimary));
|
AshColorProvider::ContentLayerType::kTextColorPrimary));
|
||||||
@@ -831,6 +837,7 @@ void NetworkListViewControllerImpl::ShowConnectionWarning(
|
|||||||
label.get(), TrayPopupUtils::FontStyle::kDetailedViewLabel);
|
label.get(), TrayPopupUtils::FontStyle::kDetailedViewLabel);
|
||||||
label->SetID(static_cast<int>(
|
label->SetID(static_cast<int>(
|
||||||
NetworkListViewControllerViewChildId::kConnectionWarningLabel));
|
NetworkListViewControllerViewChildId::kConnectionWarningLabel));
|
||||||
|
connection_warning_label_ = label.get();
|
||||||
|
|
||||||
connection_warning->AddView(TriView::Container::CENTER, std::move(label));
|
connection_warning->AddView(TriView::Container::CENTER, std::move(label));
|
||||||
connection_warning->SetContainerBorder(
|
connection_warning->SetContainerBorder(
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
namespace views {
|
namespace views {
|
||||||
class ImageView;
|
class ImageView;
|
||||||
|
class Label;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ash {
|
namespace ash {
|
||||||
@@ -218,6 +219,8 @@ class ASH_EXPORT NetworkListViewControllerImpl
|
|||||||
// is monitored by the admin, via policy, it displays the managed icon,
|
// is monitored by the admin, via policy, it displays the managed icon,
|
||||||
// otherwise the system icon.
|
// otherwise the system icon.
|
||||||
views::ImageView* connection_warning_icon_ = nullptr;
|
views::ImageView* connection_warning_icon_ = nullptr;
|
||||||
|
// Owned by `connection_warning_`.
|
||||||
|
views::Label* connection_warning_label_ = nullptr;
|
||||||
|
|
||||||
NetworkListWifiHeaderView* wifi_header_view_ = nullptr;
|
NetworkListWifiHeaderView* wifi_header_view_ = nullptr;
|
||||||
views::Separator* wifi_separator_view_ = nullptr;
|
views::Separator* wifi_separator_view_ = nullptr;
|
||||||
|
@@ -1278,6 +1278,12 @@ TEST_P(NetworkListViewControllerTest, ConnectionWarningSystemIconProxy) {
|
|||||||
GetManagedNetworkPropertiesWithProxy(/*is_managed*/ false));
|
GetManagedNetworkPropertiesWithProxy(/*is_managed*/ false));
|
||||||
AddWifiDevice();
|
AddWifiDevice();
|
||||||
|
|
||||||
|
ASSERT_THAT(GetConnectionWarning(), NotNull());
|
||||||
|
ASSERT_THAT(GetConnectionLabelView(), NotNull());
|
||||||
|
EXPECT_EQ(
|
||||||
|
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_MONITORED_WARNING),
|
||||||
|
GetConnectionLabelView()->GetText());
|
||||||
|
|
||||||
views::ImageView* icon = GetConnectionWarningIcon();
|
views::ImageView* icon = GetConnectionWarningIcon();
|
||||||
ASSERT_THAT(icon, NotNull());
|
ASSERT_THAT(icon, NotNull());
|
||||||
EXPECT_TRUE(IsSystemIcon(icon));
|
EXPECT_TRUE(IsSystemIcon(icon));
|
||||||
@@ -1291,6 +1297,12 @@ TEST_P(NetworkListViewControllerTest, ConnectionWarningManagedIconProxy) {
|
|||||||
/*is_managed=*/true));
|
/*is_managed=*/true));
|
||||||
AddWifiDevice();
|
AddWifiDevice();
|
||||||
|
|
||||||
|
ASSERT_THAT(GetConnectionWarning(), NotNull());
|
||||||
|
ASSERT_THAT(GetConnectionLabelView(), NotNull());
|
||||||
|
EXPECT_EQ(
|
||||||
|
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_MANAGED_WARNING),
|
||||||
|
GetConnectionLabelView()->GetText());
|
||||||
|
|
||||||
views::ImageView* icon = GetConnectionWarningIcon();
|
views::ImageView* icon = GetConnectionWarningIcon();
|
||||||
ASSERT_THAT(icon, NotNull());
|
ASSERT_THAT(icon, NotNull());
|
||||||
EXPECT_TRUE(IsManagedIcon(icon));
|
EXPECT_TRUE(IsManagedIcon(icon));
|
||||||
@@ -1306,6 +1318,11 @@ TEST_P(NetworkListViewControllerTest,
|
|||||||
SetDefaultNetworkForTesting(std::move(default_network));
|
SetDefaultNetworkForTesting(std::move(default_network));
|
||||||
|
|
||||||
AddWifiDevice();
|
AddWifiDevice();
|
||||||
|
ASSERT_THAT(GetConnectionWarning(), NotNull());
|
||||||
|
ASSERT_THAT(GetConnectionLabelView(), NotNull());
|
||||||
|
EXPECT_EQ(
|
||||||
|
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_MANAGED_WARNING),
|
||||||
|
GetConnectionLabelView()->GetText());
|
||||||
|
|
||||||
views::ImageView* icon = GetConnectionWarningIcon();
|
views::ImageView* icon = GetConnectionWarningIcon();
|
||||||
ASSERT_THAT(icon, NotNull());
|
ASSERT_THAT(icon, NotNull());
|
||||||
|
Reference in New Issue
Block a user