Commit 2b3079c9 authored by msramek's avatar msramek Committed by Commit bot

Expose camera settings to the extensions.

BUG=453773
DIFFBASE=880223002

Review URL: https://codereview.chromium.org/889893002

Cr-Commit-Position: refs/heads/master@{#314319}
parent 6d12da2b
......@@ -116,6 +116,11 @@ class ExtensionContentSettingsApiTest : public ExtensionApiTest {
example_url,
CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
std::string()));
EXPECT_EQ(CONTENT_SETTING_ASK,
map->GetContentSetting(example_url,
example_url,
CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
std::string()));
// Check content settings for www.google.com
GURL url("http://www.google.com");
......@@ -145,6 +150,9 @@ class ExtensionContentSettingsApiTest : public ExtensionApiTest {
EXPECT_EQ(CONTENT_SETTING_BLOCK,
map->GetContentSetting(
url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string()));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
map->GetContentSetting(
url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string()));
}
void CheckContentSettingsDefault() {
......@@ -183,6 +191,9 @@ class ExtensionContentSettingsApiTest : public ExtensionApiTest {
EXPECT_EQ(CONTENT_SETTING_ASK,
map->GetContentSetting(
url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string()));
EXPECT_EQ(CONTENT_SETTING_ASK,
map->GetContentSetting(
url, url, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string()));
}
private:
......
......@@ -30,7 +30,8 @@ const char* const kContentSettingsTypeNames[] = {
"mouselock",
"mixed-script",
"media-stream",
"media-stream-mic"
"media-stream-mic",
"media-stream-camera"
};
// TODO(msramek): Assert that |kContentSettingsTypeNames| is synced with
......
......@@ -244,6 +244,14 @@
"media-stream-mic",
{"type":"string", "enum": ["allow", "block", "ask"]}
]
},
"camera": {
"$ref": "ContentSetting",
"description": "Whether to allow sites to access the camera. One of <br><var>allow</var>: Allow sites to access the camera,<br><var>block</var>: Don't allow sites to access the camera,<br><var>ask</var>: Ask when a site wants to access the camera. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the document which requested camera access. The secondary URL is not used.",
"value": [
"media-stream-camera",
{"type":"string", "enum": ["allow", "block", "ask"]}
]
}
}
}
......
......@@ -16,6 +16,7 @@ var default_content_settings = {
"notifications": "ask",
"mouselock": "ask",
"microphone": "ask",
"camera": "ask",
};
var settings = {
......@@ -27,7 +28,8 @@ var settings = {
"location": "block",
"notifications": "block",
"mouselock": "block",
"microphone": "block"
"microphone": "block",
"camera": "block"
};
Object.prototype.forEach = function(f) {
......
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