Commit a54ae4ff authored by beaufort.francois's avatar beaufort.francois Committed by Commit bot

Added missing Privacy And Security Settings to Content Settings Sample extension.

R=mkwst@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#319030}
parent d94168ec
...@@ -2,45 +2,83 @@ ...@@ -2,45 +2,83 @@
<html> <html>
<head> <head>
<title>Popup</title> <title>Popup</title>
<style>
dt { white-space: nowrap }
</style>
<script src="popup.js"></script> <script src="popup.js"></script>
</head> </head>
<body> <body>
<fieldset> <fieldset>
<dl> <dl>
<dt><label for="cookies">Cookies: </label></dt> <dt><label for="cookies">Cookies: </label></dt>
<dd><select id="cookies"> <dd><select id="cookies" disabled>
<option value="allow">Allow</option> <option value="allow">Allow</option>
<option value="session_only">Session only</option> <option value="session_only">Session only</option>
<option value="block">Block</option> <option value="block">Block</option>
</select></dd> </select></dd>
<dt><label for="images">Images: </label></dt> <dt><label for="images">Images: </label></dt>
<dd><select id="images"> <dd><select id="images" disabled>
<option value="allow">Allow</option> <option value="allow">Allow</option>
<option value="block">Block</option> <option value="block">Block</option>
</select> </select>
<dt><label for="javascript">Javascript: </label></dt> <dt><label for="javascript">Javascript: </label></dt>
<dd><select id="javascript"> <dd><select id="javascript" disabled>
<option value="allow">Allow</option> <option value="allow">Allow</option>
<option value="block">Block</option> <option value="block">Block</option>
</select></dd> </select></dd>
<dt><label for="location">Location: </label></dt>
<dd><select id="location" disabled>
<option value="allow">Allow</option>
<option value="ask">Ask</option>
<option value="block">Block</option>
</select></dd>
<dt><label for="plugins">Plug-ins: </label></dt> <dt><label for="plugins">Plug-ins: </label></dt>
<dd><select id="plugins"> <dd><select id="plugins" disabled>
<option value="allow">Allow</option> <option value="allow">Allow</option>
<option value="block">Block</option> <option value="block">Block</option>
</select></dd> </select></dd>
<dt><label for="popups">Pop-ups: </label></dt> <dt><label for="popups">Pop-ups: </label></dt>
<dd><select id="popups"> <dd><select id="popups" disabled>
<option value="allow">Allow</option> <option value="allow">Allow</option>
<option value="block">Block</option> <option value="block">Block</option>
</select></dd> </select></dd>
<dt><label for="location">Location: </label></dt> <dt><label for="notifications">Notifications: </label></dt>
<dd><select id="location" disabled> <dd><select id="notifications" disabled>
<option value="allow">Allow</option> <option value="allow">Allow</option>
<option value="ask">Ask</option> <option value="ask">Ask</option>
<option value="block">Block</option> <option value="block">Block</option>
</select></dd> </select></dd>
<dt><label for="notifications">Notifications: </label></dt> <dt><label for="fullscreen">Fullscreen: </label></dt>
<dd><select id="notifications"> <dd><select id="fullscreen" disabled>
<option value="allow">Allow</option>
<option value="ask">Ask</option>
</select></dd>
<dt><label for="mouselock">Mouse cursor: </label></dt>
<dd><select id="mouselock" disabled>
<option value="allow">Allow</option>
<option value="ask">Ask</option>
<option value="block">Block</option>
</select></dd>
<dt><label for="microphone">Microphone: </label></dt>
<dd><select id="microphone" disabled>
<option value="allow">Allow</option>
<option value="ask">Ask</option>
<option value="block">Block</option>
</select></dd>
<dt><label for="camera">Camera: </label></dt>
<dd><select id="camera" disabled>
<option value="allow">Allow</option>
<option value="ask">Ask</option>
<option value="block">Block</option>
</select></dd>
<dt><label for="unsandboxedPlugins">Unsandboxed plug-in access: </label></dt>
<dd><select id="unsandboxedPlugins" disabled>
<option value="allow">Allow</option>
<option value="ask">Ask</option>
<option value="block">Block</option>
</select></dd>
<dt><label for="automaticDownloads">Automatic Downloads: </label></dt>
<dd><select id="automaticDownloads" disabled>
<option value="allow">Allow</option> <option value="allow">Allow</option>
<option value="ask">Ask</option> <option value="ask">Ask</option>
<option value="block">Block</option> <option value="block">Block</option>
......
...@@ -25,17 +25,20 @@ document.addEventListener('DOMContentLoaded', function () { ...@@ -25,17 +25,20 @@ document.addEventListener('DOMContentLoaded', function () {
var current = tabs[0]; var current = tabs[0];
incognito = current.incognito; incognito = current.incognito;
url = current.url; url = current.url;
var types = ['cookies', 'images', 'javascript', 'plugins', 'popups', var types = ['cookies', 'images', 'javascript', 'location', 'plugins',
'notifications']; 'popups', 'notifications', 'fullscreen', 'mouselock',
'microphone', 'camera', 'unsandboxedPlugins',
'automaticDownloads'];
types.forEach(function(type) { types.forEach(function(type) {
// HACK: [type] is not recognised by the docserver's sample crawler, so // HACK: [type] is not recognised by the docserver's sample crawler, so
// mention an explicit // mention an explicit
// type: chrome.contentSettings.cookies.get - See http://crbug.com/299634 // type: chrome.contentSettings.cookies.get - See http://crbug.com/299634
chrome.contentSettings[type].get({ chrome.contentSettings[type] && chrome.contentSettings[type].get({
'primaryUrl': url, 'primaryUrl': url,
'incognito': incognito 'incognito': incognito
}, },
function(details) { function(details) {
document.getElementById(type).disabled = false;
document.getElementById(type).value = details.setting; document.getElementById(type).value = details.setting;
}); });
}); });
......
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