Commit 31e9da72 authored by Andreea Costinas's avatar Andreea Costinas Committed by Commit Bot

Revert "Show proxy privacy warning"

This CL reverts the change in CL:2367042. The privacy team revisited
the initial decision to show the "Network may be monitored" warning
for enterprise networks and concluded it's confusing and not helpful.

Bug: 1130566, 1119754, 919691
Change-Id: Ie25dd43a61a25c0e332eda5ebcec9c08b4c59c5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2426611Reviewed-by: default avatarAndreea-Elena Costinas <acostinas@google.com>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Andreea-Elena Costinas <acostinas@google.com>
Cr-Commit-Position: refs/heads/master@{#810133}
parent d98b1176
...@@ -181,19 +181,6 @@ base::Value NetProxyConfigAsOncValue(const net::ProxyConfig& net_config, ...@@ -181,19 +181,6 @@ base::Value NetProxyConfigAsOncValue(const net::ProxyConfig& net_config,
return base::Value(); return base::Value();
} }
ProxyPrefs::ProxyMode OncStringToProxyMode(const std::string& onc_proxy_type) {
if (onc_proxy_type == ::onc::proxy::kDirect)
return ProxyPrefs::ProxyMode::MODE_DIRECT;
if (onc_proxy_type == ::onc::proxy::kWPAD)
return ProxyPrefs::ProxyMode::MODE_AUTO_DETECT;
if (onc_proxy_type == ::onc::proxy::kPAC)
return ProxyPrefs::ProxyMode::MODE_PAC_SCRIPT;
if (onc_proxy_type == ::onc::proxy::kManual)
return ProxyPrefs::ProxyMode::MODE_FIXED_SERVERS;
NOTREACHED() << "Unsupported ONC proxy type: " << onc_proxy_type;
return ProxyPrefs::ProxyMode::MODE_DIRECT;
}
} // namespace } // namespace
UIProxyConfigService::UIProxyConfigService( UIProxyConfigService::UIProxyConfigService(
...@@ -326,14 +313,6 @@ ProxyPrefs::ProxyMode UIProxyConfigService::ProxyModeForNetwork( ...@@ -326,14 +313,6 @@ ProxyPrefs::ProxyMode UIProxyConfigService::ProxyModeForNetwork(
return ProxyPrefs::MODE_DIRECT; return ProxyPrefs::MODE_DIRECT;
return mode; return mode;
} }
MergeEnforcedProxyConfig(network->guid(), &proxy_settings);
if (!proxy_settings.DictEmpty()) {
base::Value* proxy_specification_mode = proxy_settings.FindPath(
{::onc::network_config::kType, ::onc::kAugmentationActiveSetting});
if (proxy_specification_mode)
return OncStringToProxyMode(proxy_specification_mode->GetString());
}
return ProxyPrefs::ProxyMode::MODE_DIRECT; return ProxyPrefs::ProxyMode::MODE_DIRECT;
} }
......
...@@ -64,9 +64,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) UIProxyConfigService { ...@@ -64,9 +64,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) UIProxyConfigService {
// with mode == MODE_FIXED_SERVERS. // with mode == MODE_FIXED_SERVERS.
bool HasDefaultNetworkProxyConfigured(); bool HasDefaultNetworkProxyConfigured();
// Returns the ProxyMode for |network| by merging proxy configurations from // Returns the ProxyMode for |network| using |local_state_prefs_|. Proxies
// different sources, including user set, policy and extensions. See // configured by policy or extensions are not being considered. The returned
// |MergeEnforcedProxyConfig| for order of preference. // result is used to display a privacy warning to the user which in the
// context of managed networks is not helpful (see https://crbug.com/1130566).
ProxyPrefs::ProxyMode ProxyModeForNetwork(const NetworkState* network); ProxyPrefs::ProxyMode ProxyModeForNetwork(const NetworkState* network);
private: private:
......
...@@ -1251,6 +1251,9 @@ TEST_F(CrosNetworkConfigTest, NetworkStateChanged) { ...@@ -1251,6 +1251,9 @@ TEST_F(CrosNetworkConfigTest, NetworkStateChanged) {
EXPECT_EQ(0, observer()->GetNetworkChangedCount("wifi2_guid")); EXPECT_EQ(0, observer()->GetNetworkChangedCount("wifi2_guid"));
} }
// Do not forward information about proxies set by policy.
// |NetworkStatePropertiesPtr::proxy_mode| is used to show a privacy warning in
// the system tray. This warning should not be shown for managed networks.
TEST_F(CrosNetworkConfigTest, PolicyEnforcedProxyMode) { TEST_F(CrosNetworkConfigTest, PolicyEnforcedProxyMode) {
// Proxies enforced by policy and/or extension are set in the kProxy // Proxies enforced by policy and/or extension are set in the kProxy
// preference. // preference.
...@@ -1261,7 +1264,7 @@ TEST_F(CrosNetworkConfigTest, PolicyEnforcedProxyMode) { ...@@ -1261,7 +1264,7 @@ TEST_F(CrosNetworkConfigTest, PolicyEnforcedProxyMode) {
mojom::NetworkStatePropertiesPtr network = GetNetworkState("wifi2_guid"); mojom::NetworkStatePropertiesPtr network = GetNetworkState("wifi2_guid");
ASSERT_TRUE(network); ASSERT_TRUE(network);
EXPECT_EQ(network->proxy_mode, mojom::ProxyMode::kAutoDetect); EXPECT_EQ(network->proxy_mode, mojom::ProxyMode::kDirect);
} }
} // namespace network_config } // namespace network_config
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment