Chromium Code Reviews| Index: chrome/browser/resources/options/website_settings_edit_page.js |
| diff --git a/chrome/browser/resources/options/website_settings_edit_page.js b/chrome/browser/resources/options/website_settings_edit_page.js |
| index deba565ef7b202aede7f26b428aba5456964d49a..be615bad59419b4661266815836650711526672e 100644 |
| --- a/chrome/browser/resources/options/website_settings_edit_page.js |
| +++ b/chrome/browser/resources/options/website_settings_edit_page.js |
| @@ -17,7 +17,19 @@ cr.define('options.WebsiteSettings', function() { |
| loadTimeData.getString('websitesOptionsPageTabTitle'), |
| 'website-settings-edit-page'); |
| this.permissions = ['geolocation', 'notifications', 'media-stream', |
| - 'cookies']; |
| + 'cookies', 'multiple-automatic-downloads', 'images', |
| + 'plugins', 'popups', 'javascript']; |
| + this.permissionsLookup = { |
| + 'geolocation': 'Location', |
| + 'notifications': 'Notifications', |
| + 'media-stream': 'MediaStream', |
| + 'cookies': 'Cookies', |
| + 'multiple-automatic-downloads': 'MultipleAutomaticDownloads', |
|
Bernhard Bauer
2014/09/05 18:41:36
If we have a custom mapping here anyway, could we
Daniel Nishi
2014/09/05 19:21:38
Done.
|
| + 'images': 'Images', |
| + 'plugins': 'Plugins', |
| + 'popups': 'Popups', |
| + 'javascript': 'Javascript' |
| + }; |
| } |
| cr.addSingletonGetter(WebsiteSettingsEditor); |
| @@ -45,6 +57,13 @@ cr.define('options.WebsiteSettings', function() { |
| WebsiteSettingsEditor.getInstance().updatePermissions(); |
| PageManager.closeOverlay.bind(PageManager)(); |
| }; |
| + |
| + var permissionList = |
| + this.pageDiv.querySelector('.origin-permission-list'); |
| + for (var key in this.permissions) { |
| + permissionList.appendChild( |
| + this.makePermissionOption_(this.permissions[key])); |
| + } |
| }, |
| /** |
| @@ -103,6 +122,29 @@ cr.define('options.WebsiteSettings', function() { |
| } |
| } |
| }, |
| + |
| + /** |
| + * Populates the origin permission list with the different usable |
| + * permissions. |
| + * @param {string} permissionName A string with the permission name. |
| + * @return {Element} The element with the usable permission setting. |
| + */ |
| + makePermissionOption_: function(permissionName) { |
| + var permissionOption = cr.doc.createElement('div'); |
| + permissionOption.className = 'permission-option'; |
| + |
| + var permissionNameSpan = cr.doc.createElement('span'); |
| + permissionNameSpan.className = 'permission-name'; |
| + permissionNameSpan.textContent = loadTimeData.getString('websites' + |
| + this.permissionsLookup[permissionName] + 'Description'); |
| + permissionOption.appendChild(permissionNameSpan); |
| + |
| + var permissionSelector = cr.doc.createElement('select'); |
| + permissionSelector.setAttribute('id', permissionName + '-select-option'); |
| + permissionSelector.className = 'weaktrl permission-selection-option'; |
| + permissionOption.appendChild(permissionSelector); |
| + return permissionOption; |
| + }, |
| }; |
| WebsiteSettingsEditor.populateOrigin = function(localStorage, batteryUsage, |