From b2e83208f8e974ad7ee726332fd471c8852057a3 Mon Sep 17 00:00:00 2001 From: Xiyuan Xia Date: Thu, 28 Jan 2016 15:44:57 -0800 Subject: Remove deprecated policy DeviceProxySettingsProto BUG=chromium:442466 TEST=none Change-Id: I39f474bc5a53f0a9b199ea557924726bb988e58a --- policy/device_policy.h | 16 ------------ policy/device_policy_impl.cc | 53 -------------------------------------- policy/device_policy_impl.h | 4 --- policy/mock_device_policy.h | 4 --- policy/tests/libpolicy_unittest.cc | 13 ---------- 5 files changed, 90 deletions(-) diff --git a/policy/device_policy.h b/policy/device_policy.h index 7a60a65..34e7a64 100644 --- a/policy/device_policy.h +++ b/policy/device_policy.h @@ -83,22 +83,6 @@ class DevicePolicy { virtual bool GetEphemeralUsersEnabled( bool* ephemeral_users_enabled) const = 0; - // Writes the value of the ProxyMode policy in |proxy_mode|. Returns true on - // success. - virtual bool GetProxyMode(std::string* proxy_mode) const = 0; - - // Writes the value of the ProxyServer policy in |proxy_server|. Returns true - // on success. - virtual bool GetProxyServer(std::string* proxy_server) const = 0; - - // Writes the value of the ProxyPacUrl policy in |proxy_pac|. Returns true on - // success. - virtual bool GetProxyPacUrl(std::string* proxy_pac) const = 0; - - // Writes the value of the ProxyBypassList policy in |proxy_bypass_list|. - // Returns true on success. - virtual bool GetProxyBypassList(std::string* proxy_bypass_list) const = 0; - // Writes the value of the release channel policy in |release_channel|. // Returns true on success. virtual bool GetReleaseChannel(std::string* release_channel) const = 0; diff --git a/policy/device_policy_impl.cc b/policy/device_policy_impl.cc index 7d9bc60..565fb62 100644 --- a/policy/device_policy_impl.cc +++ b/policy/device_policy_impl.cc @@ -246,59 +246,6 @@ bool DevicePolicyImpl::GetEphemeralUsersEnabled( return true; } -bool DevicePolicyImpl::GetProxyMode(std::string* proxy_mode) const { - if (!device_policy_.has_device_proxy_settings()) - return false; - - const enterprise_management::DeviceProxySettingsProto& proto = - device_policy_.device_proxy_settings(); - if (!proto.has_proxy_mode()) - return false; - - *proxy_mode = proto.proxy_mode(); - return true; -} - -bool DevicePolicyImpl::GetProxyServer(std::string* proxy_server) const { - if (!device_policy_.has_device_proxy_settings()) - return false; - - const enterprise_management::DeviceProxySettingsProto& proto = - device_policy_.device_proxy_settings(); - if (!proto.has_proxy_server()) - return false; - - *proxy_server = proto.proxy_server(); - return true; -} - -bool DevicePolicyImpl::GetProxyPacUrl(std::string* proxy_pac) const { - if (!device_policy_.has_device_proxy_settings()) - return false; - - const enterprise_management::DeviceProxySettingsProto& proto = - device_policy_.device_proxy_settings(); - if (!proto.has_proxy_pac_url()) - return false; - - *proxy_pac = proto.proxy_pac_url(); - return true; -} - -bool DevicePolicyImpl::GetProxyBypassList( - std::string* proxy_bypass_list) const { - if (!device_policy_.has_device_proxy_settings()) - return false; - - const enterprise_management::DeviceProxySettingsProto& proto = - device_policy_.device_proxy_settings(); - if (!proto.has_proxy_bypass_list()) - return false; - - *proxy_bypass_list = proto.proxy_bypass_list(); - return true; -} - bool DevicePolicyImpl::GetReleaseChannel( std::string* release_channel) const { if (!device_policy_.has_release_channel()) diff --git a/policy/device_policy_impl.h b/policy/device_policy_impl.h index 7174ce1..7733469 100644 --- a/policy/device_policy_impl.h +++ b/policy/device_policy_impl.h @@ -43,10 +43,6 @@ class DevicePolicyImpl : public DevicePolicy { virtual bool GetReportActivityTimes(bool* report_activity_times) const; virtual bool GetReportBootMode(bool* report_boot_mode) const; virtual bool GetEphemeralUsersEnabled(bool* ephemeral_users_enabled) const; - virtual bool GetProxyMode(std::string* proxy_mode) const; - virtual bool GetProxyServer(std::string* proxy_server) const; - virtual bool GetProxyPacUrl(std::string* proxy_pac) const; - virtual bool GetProxyBypassList(std::string* proxy_bypass_list) const; virtual bool GetReleaseChannel(std::string* release_channel) const; virtual bool GetReleaseChannelDelegated( bool* release_channel_delegated) const; diff --git a/policy/mock_device_policy.h b/policy/mock_device_policy.h index bd53787..0986bb6 100644 --- a/policy/mock_device_policy.h +++ b/policy/mock_device_policy.h @@ -76,10 +76,6 @@ class MockDevicePolicy : public DevicePolicy { bool(bool*)); // NOLINT(readability/function) MOCK_CONST_METHOD1(GetEphemeralUsersEnabled, bool(bool*)); // NOLINT(readability/function) - MOCK_CONST_METHOD1(GetProxyMode, bool(std::string*)); - MOCK_CONST_METHOD1(GetProxyServer, bool(std::string*)); - MOCK_CONST_METHOD1(GetProxyPacUrl, bool(std::string*)); - MOCK_CONST_METHOD1(GetProxyBypassList, bool(std::string*)); MOCK_CONST_METHOD1(GetReleaseChannel, bool(std::string*)); MOCK_CONST_METHOD1(GetReleaseChannelDelegated, bool(bool*)); // NOLINT(readability/function) diff --git a/policy/tests/libpolicy_unittest.cc b/policy/tests/libpolicy_unittest.cc index 45475b5..02e800d 100644 --- a/policy/tests/libpolicy_unittest.cc +++ b/policy/tests/libpolicy_unittest.cc @@ -111,19 +111,6 @@ TEST(PolicyTest, DevicePolicyAllSetTest) { ASSERT_TRUE(policy.GetEphemeralUsersEnabled(&bool_value)); ASSERT_FALSE(bool_value); - std::string string_value; - ASSERT_TRUE(policy.GetProxyMode(&string_value)); - ASSERT_EQ("direct", string_value); - - ASSERT_TRUE(policy.GetProxyServer(&string_value)); - ASSERT_EQ("myproxy", string_value); - - ASSERT_TRUE(policy.GetProxyPacUrl(&string_value)); - ASSERT_EQ("http://mypac.pac", string_value); - - ASSERT_TRUE(policy.GetProxyBypassList(&string_value)); - ASSERT_EQ("a, b, c", string_value); - ASSERT_TRUE(policy.GetReleaseChannel(&string_value)); ASSERT_EQ("stable-channel", string_value); -- cgit v1.2.3