Commit 6b72640c authored by mkwst's avatar mkwst Committed by Commit bot

Add `chrome.contentSettings.location`.

Most everything was already in place for this, we just needed to wire
it up to the external API.

BUG=447989
R=bauerb@chromium.org,kalman@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#311462}
parent ee9d35aa
...@@ -96,15 +96,11 @@ class ExtensionContentSettingsApiTest : public ExtensionApiTest { ...@@ -96,15 +96,11 @@ class ExtensionContentSettingsApiTest : public ExtensionApiTest {
example_url, example_url,
CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTINGS_TYPE_POPUPS,
std::string())); std::string()));
#if 0 EXPECT_EQ(CONTENT_SETTING_ASK,
// TODO(bauerb): Enable once geolocation settings are integrated into the
// HostContentSettingsMap.
EXPECT_EQ(CONTENT_SETTING_ALLOW,
map->GetContentSetting(example_url, map->GetContentSetting(example_url,
example_url, example_url,
CONTENT_SETTINGS_TYPE_GEOLOCATION, CONTENT_SETTINGS_TYPE_GEOLOCATION,
std::string())); std::string()));
#endif
EXPECT_EQ(CONTENT_SETTING_ASK, EXPECT_EQ(CONTENT_SETTING_ASK,
map->GetContentSetting(example_url, map->GetContentSetting(example_url,
example_url, example_url,
...@@ -126,11 +122,9 @@ class ExtensionContentSettingsApiTest : public ExtensionApiTest { ...@@ -126,11 +122,9 @@ class ExtensionContentSettingsApiTest : public ExtensionApiTest {
EXPECT_EQ(CONTENT_SETTING_ALLOW, EXPECT_EQ(CONTENT_SETTING_ALLOW,
map->GetContentSetting( map->GetContentSetting(
url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string())); url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string()));
#if 0
EXPECT_EQ(CONTENT_SETTING_BLOCK, EXPECT_EQ(CONTENT_SETTING_BLOCK,
map->GetContentSetting( map->GetContentSetting(
url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string())); url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
#endif
EXPECT_EQ( EXPECT_EQ(
CONTENT_SETTING_BLOCK, CONTENT_SETTING_BLOCK,
map->GetContentSetting( map->GetContentSetting(
...@@ -160,13 +154,9 @@ class ExtensionContentSettingsApiTest : public ExtensionApiTest { ...@@ -160,13 +154,9 @@ class ExtensionContentSettingsApiTest : public ExtensionApiTest {
EXPECT_EQ(CONTENT_SETTING_BLOCK, EXPECT_EQ(CONTENT_SETTING_BLOCK,
map->GetContentSetting( map->GetContentSetting(
url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string())); url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string()));
#if 0 EXPECT_EQ(CONTENT_SETTING_ASK,
// TODO(bauerb): Enable once geolocation settings are integrated into the
// HostContentSettingsMap.
EXPECT_EQ(CONTENT_SETTING_ALLOW,
map->GetContentSetting( map->GetContentSetting(
url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string())); url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
#endif
EXPECT_EQ( EXPECT_EQ(
CONTENT_SETTING_ASK, CONTENT_SETTING_ASK,
map->GetContentSetting( map->GetContentSetting(
......
...@@ -197,6 +197,14 @@ ...@@ -197,6 +197,14 @@
{"type":"string", "enum": ["allow", "block"]} {"type":"string", "enum": ["allow", "block"]}
] ]
}, },
"location": {
"$ref": "ContentSetting",
"description": "Whether to allow Geolocation. One of <br><var>allow</var>: Allow sites to track your physical location,<br><var>block</var>: Don't allow sites to track your physical location,<br><var>ask</var>: Ask before allowing sites to track your physical location. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the document which requested location data. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL).",
"value": [
"location",
{"type":"string", "enum": ["allow", "block", "ask"]}
]
},
"plugins": { "plugins": {
"$ref": "ContentSetting", "$ref": "ContentSetting",
"description": "Whether to run plug-ins. One of<br><var>allow</var>: Run plug-ins automatically,<br><var>block</var>: Don't run plug-ins automatically. <br>Default is <var>allow</var>.<br>The primary URL is the main-frame URL. The secondary URL is not used.", "description": "Whether to run plug-ins. One of<br><var>allow</var>: Run plug-ins automatically,<br><var>block</var>: Don't run plug-ins automatically. <br>Default is <var>allow</var>.<br>The primary URL is the main-frame URL. The secondary URL is not used.",
......
...@@ -12,8 +12,7 @@ var default_content_settings = { ...@@ -12,8 +12,7 @@ var default_content_settings = {
"javascript": "block", "javascript": "block",
"plugins": "allow", "plugins": "allow",
"popups": "block", "popups": "block",
// TODO(bauerb) "location": "ask",
// "geolocation": "ask",
"notifications": "ask" "notifications": "ask"
}; };
...@@ -23,7 +22,7 @@ var settings = { ...@@ -23,7 +22,7 @@ var settings = {
"javascript": "block", "javascript": "block",
"plugins": "block", "plugins": "block",
"popups": "allow", "popups": "allow",
// "geolocation": "block", "location": "block",
"notifications": "block" "notifications": "block"
}; };
......
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