diff options
author | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 16:54:24 +0000 |
---|---|---|
committer | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 16:54:24 +0000 |
commit | 7cdf00c22466989309283d9d0e7f8a766a81195a (patch) | |
tree | 5bfa75deb7601f84e735cb7dc8ef0896370d04d7 | |
parent | 4948224cf84ffaa8f0b097852a8e4a3699552e4a (diff) | |
download | chromium_src-7cdf00c22466989309283d9d0e7f8a766a81195a.zip chromium_src-7cdf00c22466989309283d9d0e7f8a766a81195a.tar.gz chromium_src-7cdf00c22466989309283d9d0e7f8a766a81195a.tar.bz2 |
EnableTranslate policy.
BUG=59767
TEST=Set the policy, and users can't change the Translate preference anymore.
Review URL: http://codereview.chromium.org/6722024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79138 0039d316-1c4b-4281-b951-d872f2087c98
7 files changed, 35 insertions, 5 deletions
diff --git a/chrome/app/policy/policy_templates.json b/chrome/app/policy/policy_templates.json index 03abace..1fe9356 100644 --- a/chrome/app/policy/policy_templates.json +++ b/chrome/app/policy/policy_templates.json @@ -94,7 +94,7 @@ # persistent IDs for all fields (but not for groups!) are needed. These are # specified by the 'id' keys of each policy. NEVER CHANGE EXISTING IDs, # because doing so would break the deployed wire format! -# For your editing convenience: highest ID currently used: 79 +# For your editing convenience: highest ID currently used: 80 # # Placeholders: # The following placeholder strings are automatically substituted: @@ -1403,6 +1403,22 @@ If you enable or disable this setting, users cannot change or override this setting.''', }, + { + 'name': 'TranslateEnabled', + 'type': 'main', + 'supported_on': ['chrome.*:12-', 'chrome_os:0.11-'], + 'features': {'dynamic_refresh': 1}, + 'example_value': True, + 'id': 80, + 'caption': '''Enable Translate''', + 'desc': '''Enables the integrated Google Translate service on <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. + + If you enable this setting, <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> will show an integrated toolbar offering to translate the page for the user, when appropriate. + + If you disable this setting, users will never see the translation bar. + + If you enable or disable this setting, users cannot change or override this setting in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.''', + }, ], 'messages': { # Messages that are not associated to any policies. diff --git a/chrome/browser/policy/config_dir_policy_provider_unittest.cc b/chrome/browser/policy/config_dir_policy_provider_unittest.cc index ae15a2c..22ea5e5 100644 --- a/chrome/browser/policy/config_dir_policy_provider_unittest.cc +++ b/chrome/browser/policy/config_dir_policy_provider_unittest.cc @@ -350,6 +350,9 @@ INSTANTIATE_TEST_CASE_P( key::kDefaultBrowserSettingEnabled), ValueTestParams::ForBooleanPolicy( kPolicyCloudPrintProxyEnabled, - key::kCloudPrintProxyEnabled))); + key::kCloudPrintProxyEnabled), + ValueTestParams::ForBooleanPolicy( + kPolicyTranslateEnabled, + key::kTranslateEnabled))); } // namespace policy diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc index e607f56..6933116 100644 --- a/chrome/browser/policy/configuration_policy_pref_store.cc +++ b/chrome/browser/policy/configuration_policy_pref_store.cc @@ -267,6 +267,7 @@ const ConfigurationPolicyPrefKeeper::PolicyToPreferenceMapEntry prefs::kDefaultBrowserSettingEnabled }, { Value::TYPE_BOOLEAN, kPolicyCloudPrintProxyEnabled, prefs::kCloudPrintProxyEnabled }, + { Value::TYPE_BOOLEAN, kPolicyTranslateEnabled, prefs::kEnableTranslate }, #if defined(OS_CHROMEOS) { Value::TYPE_BOOLEAN, kPolicyChromeOsLockOnIdleSuspend, @@ -975,6 +976,7 @@ ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList() { key::kCloudPrintProxyEnabled }, { kPolicyDownloadDirectory, Value::TYPE_STRING, key::kDownloadDirectory }, + { kPolicyTranslateEnabled, Value::TYPE_BOOLEAN, key::kTranslateEnabled }, #if defined(OS_CHROMEOS) { kPolicyChromeOsLockOnIdleSuspend, Value::TYPE_BOOLEAN, diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc index 6db2f38..edd2e43 100644 --- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc +++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc @@ -203,7 +203,9 @@ INSTANTIATE_TEST_CASE_P( TypeAndName(kPolicyDefaultBrowserSettingEnabled, prefs::kDefaultBrowserSettingEnabled), TypeAndName(kPolicyDisable3DAPIs, - prefs::kDisable3DAPIs))); + prefs::kDisable3DAPIs), + TypeAndName(kPolicyTranslateEnabled, + prefs::kEnableTranslate))); #if defined(OS_CHROMEOS) INSTANTIATE_TEST_CASE_P( diff --git a/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc b/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc index 0bcf002..7bf04ee 100644 --- a/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc +++ b/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc @@ -321,6 +321,9 @@ INSTANTIATE_TEST_CASE_P( key::kDefaultBrowserSettingEnabled), PolicyTestParams::ForBooleanPolicy( kPolicyCloudPrintProxyEnabled, - key::kCloudPrintProxyEnabled))); + key::kCloudPrintProxyEnabled), + PolicyTestParams::ForBooleanPolicy( + kPolicyTranslateEnabled, + key::kTranslateEnabled))); } // namespace policy diff --git a/chrome/browser/policy/configuration_policy_provider_win_unittest.cc b/chrome/browser/policy/configuration_policy_provider_win_unittest.cc index 939912a..aa11d1f 100644 --- a/chrome/browser/policy/configuration_policy_provider_win_unittest.cc +++ b/chrome/browser/policy/configuration_policy_provider_win_unittest.cc @@ -479,6 +479,9 @@ INSTANTIATE_TEST_CASE_P( key::kDefaultBrowserSettingEnabled), PolicyTestParams::ForBooleanPolicy( kPolicyCloudPrintProxyEnabled, - key::kCloudPrintProxyEnabled))); + key::kCloudPrintProxyEnabled), + PolicyTestParams::ForBooleanPolicy( + kPolicyTranslateEnabled, + key::kTranslateEnabled))); } // namespace policy diff --git a/chrome/browser/policy/managed_prefs_banner_base.cc b/chrome/browser/policy/managed_prefs_banner_base.cc index d5a4a83..4b82ae3 100644 --- a/chrome/browser/policy/managed_prefs_banner_base.cc +++ b/chrome/browser/policy/managed_prefs_banner_base.cc @@ -94,6 +94,7 @@ void ManagedPrefsBannerBase::Init(PrefService* local_state, AddUserPref(prefs::kProxy); AddUserPref(prefs::kCloudPrintProxyEnabled); AddUserPref(prefs::kDownloadDefaultDirectory); + AddUserPref(prefs::kEnableTranslate); break; #if defined(OS_CHROMEOS) case OPTIONS_PAGE_ACCOUNTS: |