summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-09 16:54:57 +0000
committermkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-09 16:54:57 +0000
commitcc3a5c8ca42579c0f9f710c18f51c566b4c75e86 (patch)
tree82f99399e0e8e3afa4ec97960a232991039b8665
parenta162b409e0bb2f78fd3b9c0a495f61bd0368977a (diff)
downloadchromium_src-cc3a5c8ca42579c0f9f710c18f51c566b4c75e86.zip
chromium_src-cc3a5c8ca42579c0f9f710c18f51c566b4c75e86.tar.gz
chromium_src-cc3a5c8ca42579c0f9f710c18f51c566b4c75e86.tar.bz2
Adding `protectedContentEnabled` toggle to the Privacy extension API.
BUG=126612 TEST=browser_tests Review URL: https://chromiumcodereview.appspot.com/10382052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136049 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_preference_api.cc6
-rw-r--r--chrome/common/extensions/api/privacy.json8
-rw-r--r--chrome/common/extensions/docs/privacy.html25
-rw-r--r--chrome/test/data/extensions/api_test/preference/standard/test.js13
4 files changed, 49 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_preference_api.cc b/chrome/browser/extensions/extension_preference_api.cc
index 4dd149c..2de541a 100644
--- a/chrome/browser/extensions/extension_preference_api.cc
+++ b/chrome/browser/extensions/extension_preference_api.cc
@@ -48,6 +48,12 @@ struct PrefMappingEntry {
const char kOnPrefChangeFormat[] = "types.ChromeSetting.%s.onChange";
PrefMappingEntry kPrefMapping[] = {
+#if defined(OS_CHROMEOS)
+ { "protectedContentEnabled",
+ prefs::kEnableCrosDRM,
+ ExtensionAPIPermission::kPrivacy
+ },
+#endif // defined(OS_CHROMEOS)
{ "alternateErrorPagesEnabled",
prefs::kAlternateErrorPagesEnabled,
ExtensionAPIPermission::kPrivacy
diff --git a/chrome/common/extensions/api/privacy.json b/chrome/common/extensions/api/privacy.json
index 5e748a8..c3e144b 100644
--- a/chrome/common/extensions/api/privacy.json
+++ b/chrome/common/extensions/api/privacy.json
@@ -64,7 +64,7 @@
"websites": {
"type": "object",
"value": {},
- "description": "Settings that determine what information Chrome sends when requesting websites.",
+ "description": "Settings that determine what information Chrome makes available to websites.",
"properties": {
"thirdPartyCookiesAllowed": {
"$ref": "ChromeSetting",
@@ -80,6 +80,12 @@
"$ref": "ChromeSetting",
"value": ["referrersEnabled", {"type":"boolean"}],
"description": "If enabled, Chrome sends <code>referer</code> headers with your requests. Yes, the name of this preference doesn't match the misspelled header. No, we're not going to change it. The value of this preference is of type boolean, and the default value is <code>true</code>."
+ },
+ "protectedContentEnabled": {
+ "$ref": "ChromeSetting",
+ "value": ["protectedContentEnabled", {"type":"boolean"}],
+ "description": "<strong>Available on ChromeOS only</strong>: If enabled, Chrome provides a unique ID to plugins in order to run protected content. The value of this preference is of type boolean, and the default value is <code>true</code>.",
+ "platforms": ["cros", "cros touch"]
}
}
}
diff --git a/chrome/common/extensions/docs/privacy.html b/chrome/common/extensions/docs/privacy.html
index 7397caf2..ccb5867 100644
--- a/chrome/common/extensions/docs/privacy.html
+++ b/chrome/common/extensions/docs/privacy.html
@@ -707,7 +707,7 @@
</div>
</em>
</dt>
- <dd>Settings that determine what information Chrome sends when requesting websites.</dd>
+ <dd>Settings that determine what information Chrome makes available to websites.</dd>
<!-- OBJECT PROPERTIES -->
<dd>
<dl>
@@ -780,6 +780,29 @@
<!-- OBJECT EVENT FIELDS -->
<!-- FUNCTION PARAMETERS -->
</div>
+ </div><div>
+ <div>
+ <dt>
+ <var>protectedContentEnabled</var>
+ <em>
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span id="typeTemplate">
+ <span>
+ <a href="types.html#type-ChromeSetting">ChromeSetting</a>
+ </span>
+ </span>
+ )
+ </div>
+ </em>
+ </dt>
+ <dd><strong>Available on ChromeOS only</strong>: If enabled, Chrome provides a unique ID to plugins in order to run protected content. The value of this preference is of type boolean, and the default value is <code>true</code>.</dd>
+ <!-- OBJECT PROPERTIES -->
+ <!-- OBJECT METHODS -->
+ <!-- OBJECT EVENT FIELDS -->
+ <!-- FUNCTION PARAMETERS -->
+ </div>
</div>
</dl>
</dd>
diff --git a/chrome/test/data/extensions/api_test/preference/standard/test.js b/chrome/test/data/extensions/api_test/preference/standard/test.js
index bb3f7f7..db78a66 100644
--- a/chrome/test/data/extensions/api_test/preference/standard/test.js
+++ b/chrome/test/data/extensions/api_test/preference/standard/test.js
@@ -17,7 +17,8 @@ var preferences_to_test = [
preferences: [
'thirdPartyCookiesAllowed',
'hyperlinkAuditingEnabled',
- 'referrersEnabled'
+ 'referrersEnabled',
+ 'protectedContentEnabled'
]
},
{
@@ -48,10 +49,20 @@ function expectFalse(pref) {
}
function prefGetter(pref) {
+ if (pref === 'protectedContentEnabled' && !this[pref]) {
+ // `protectedContentEnabled` is ChromeOS only, so it might not exist when
+ // this test runs, and that's pretty much OK.
+ return true;
+ }
this[pref].get({}, expectFalse(pref));
}
function prefSetter(pref) {
+ if (pref === 'protectedContentEnabled' && !this[pref]) {
+ // `protectedContentEnabled` is ChromeOS only, so it might not exist when
+ // this test runs, and that's pretty much OK.
+ return true;
+ }
this[pref].set({value: true}, chrome.test.callbackPass());
}