diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 14:38:58 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 14:38:58 +0000 |
commit | 06a26cee05ab7e5c49f7dc5b07ed6224fe4876db (patch) | |
tree | 713d1936c9e5cc3720e562c54d3debe7a2c56e60 /chrome | |
parent | 294d4309fc817b6e0bc56b46a5cafbe62fc78608 (diff) | |
download | chromium_src-06a26cee05ab7e5c49f7dc5b07ed6224fe4876db.zip chromium_src-06a26cee05ab7e5c49f7dc5b07ed6224fe4876db.tar.gz chromium_src-06a26cee05ab7e5c49f7dc5b07ed6224fe4876db.tar.bz2 |
Implement policy for enabling/disabling JavaScript.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3395011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60288 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/policy/policy_templates.grd | 21 | ||||
-rw-r--r-- | chrome/app/policy/policy_templates.json | 13 | ||||
-rw-r--r-- | chrome/browser/policy/configuration_policy_pref_store.cc | 4 | ||||
-rw-r--r-- | chrome/browser/policy/configuration_policy_pref_store_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/policy/configuration_policy_store.h | 1 | ||||
-rw-r--r-- | chrome/common/policy_constants.cc | 1 | ||||
-rw-r--r-- | chrome/common/policy_constants.h | 1 |
7 files changed, 39 insertions, 6 deletions
diff --git a/chrome/app/policy/policy_templates.grd b/chrome/app/policy/policy_templates.grd index 9d35fe9..ad81774 100644 --- a/chrome/app/policy/policy_templates.grd +++ b/chrome/app/policy/policy_templates.grd @@ -216,6 +216,17 @@ templates and will be translated for each locale. --> 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>. </message> + <message name="IDS_POLICY_GROUP_JAVASCRIPTENABLED_CAPTION" desc="Caption of the 'JavaScript enabled' policy settings page."> + Enable JavaScript + </message> + <message name="IDS_POLICY_GROUP_JAVASCRIPTENABLED_DESC" desc="Description of the 'JavaScript enabled' policy settings page."> + Enables JavaScript in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> and prevents users from changing this setting. + + If this setting is enabled or not configured, web pages can use JavaScript. + + If this setting is disabled, web pages cannot use JavaScript. + </message> + <message name="IDS_POLICY_GROUP_AUTOFILLENABLED_CAPTION" desc="Caption of the 'autofill' policy settings page."> Enable AutoFill @@ -229,7 +240,7 @@ templates and will be translated for each locale. --> If you enable this setting, AutoFill is always active. If you disable this setting, AutoFill is never active. - + 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>. </message> @@ -245,7 +256,7 @@ templates and will be translated for each locale. --> If you enable this setting, the Home button is always shown. If you disable this setting, the Home button is never shown. - + 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>. </message> @@ -447,10 +458,10 @@ templates and will be translated for each locale. --> If you choose 'Open a list of URLs on startup', the list of 'URLs to open on startup' will be opened when a user starts <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. 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>. - </message> - + </message> + <message name="IDS_POLICY_RESTOREONSTARTUP_CAPTION" desc="Caption of the dropbox 'restore on startup mode' of the policy settings page 'restore on startup'."> - Action on startup + Action on startup </message> <message name="IDS_POLICY_RESTOREONSTARTUP_DESC" desc="Description of the dropbox 'restore on startup mode' of the policy settings page 'restore on startup'"> Allows you to specify the behavior on startup. diff --git a/chrome/app/policy/policy_templates.json b/chrome/app/policy/policy_templates.json index ff75daa..7b986ce 100644 --- a/chrome/app/policy/policy_templates.json +++ b/chrome/app/policy/policy_templates.json @@ -165,6 +165,19 @@ }], }, { + 'name': 'JavascriptEnabled', + 'policies': [{ + 'name': 'JavascriptEnabled', + 'type': 'main', + 'annotations': { + 'platforms': ['linux', 'mac', 'win'], + 'products': ['chrome'], + 'features': {'dynamic_refresh': 0}, + 'example_value': True, + } + }], + }, + { 'name': 'SafeBrowsingEnabled', 'policies': [{ 'name': 'SafeBrowsingEnabled', diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc index 296094e..dde144b 100644 --- a/chrome/browser/policy/configuration_policy_pref_store.cc +++ b/chrome/browser/policy/configuration_policy_pref_store.cc @@ -126,6 +126,8 @@ const ConfigurationPolicyPrefStore::PolicyToPreferenceMapEntry prefs::kPluginsPluginsBlacklist}, { Value::TYPE_BOOLEAN, kPolicyShowHomeButton, prefs::kShowHomeButton }, + { Value::TYPE_BOOLEAN, kPolicyJavascriptEnabled, + prefs::kWebKitJavascriptEnabled }, }; const ConfigurationPolicyPrefStore::PolicyToPreferenceMapEntry @@ -213,6 +215,8 @@ ConfigurationPolicyPrefStore::GetChromePolicyValueMap() { Value::TYPE_BOOLEAN, key::kShowHomeButton }, { ConfigurationPolicyStore::kPolicyPrintingEnabled, Value::TYPE_BOOLEAN, key::kPrintingEnabled }, + { ConfigurationPolicyStore::kPolicyJavascriptEnabled, + Value::TYPE_BOOLEAN, key::kJavascriptEnabled }, }; ConfigurationPolicyProvider::StaticPolicyValueMap map = { diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc index 1786ea6..6b1bbe5 100644 --- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc +++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc @@ -157,7 +157,9 @@ INSTANTIATE_TEST_CASE_P( TypeAndName(ConfigurationPolicyStore::kPolicyShowHomeButton, prefs::kShowHomeButton), TypeAndName(ConfigurationPolicyStore::kPolicyPrintingEnabled, - prefs::kPrintingEnabled))); + prefs::kPrintingEnabled), + TypeAndName(ConfigurationPolicyStore::kPolicyJavascriptEnabled, + prefs::kWebKitJavascriptEnabled))); // Test cases for integer-valued policy settings. class ConfigurationPolicyPrefStoreIntegerTest diff --git a/chrome/browser/policy/configuration_policy_store.h b/chrome/browser/policy/configuration_policy_store.h index 461ee17..dacfa37 100644 --- a/chrome/browser/policy/configuration_policy_store.h +++ b/chrome/browser/policy/configuration_policy_store.h @@ -52,6 +52,7 @@ class ConfigurationPolicyStore { kPolicyChromeFrameRendererSettings, kPolicyRenderInChromeFrameList, kPolicyRenderInHostList, + kPolicyJavascriptEnabled, }; static const int kPolicyNoProxyServerMode = 0; diff --git a/chrome/common/policy_constants.cc b/chrome/common/policy_constants.cc index 1967f44..6ab9a32 100644 --- a/chrome/common/policy_constants.cc +++ b/chrome/common/policy_constants.cc @@ -50,6 +50,7 @@ const char kExtensionInstallAllowList[] = "ExtensionInstallWhitelist"; const char kExtensionInstallDenyList[] = "ExtensionInstallBlacklist"; const char kShowHomeButton[] = "ShowHomeButton"; const char kPrintingEnabled[] = "PrintingEnabled"; +const char kJavascriptEnabled[] = "JavascriptEnabled"; // Chrome Frame specific policy constants const char kChromeFrameRendererSettings[] = "ChromeFrameRendererSettings"; diff --git a/chrome/common/policy_constants.h b/chrome/common/policy_constants.h index 6eb7ae0..783cfe9 100644 --- a/chrome/common/policy_constants.h +++ b/chrome/common/policy_constants.h @@ -47,6 +47,7 @@ extern const char kExtensionInstallAllowList[]; extern const char kExtensionInstallDenyList[]; extern const char kShowHomeButton[]; extern const char kPrintingEnabled[]; +extern const char kJavascriptEnabled[]; // Chrome Frame specific policy constants extern const char kChromeFrameRendererSettings[]; |