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..558cea04b25ac04fb2dfb48f2234fae6cdd79d99 100644 |
| --- a/chrome/browser/resources/options/website_settings_edit_page.js |
| +++ b/chrome/browser/resources/options/website_settings_edit_page.js |
| @@ -17,7 +17,8 @@ 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']; |
| } |
| cr.addSingletonGetter(WebsiteSettingsEditor); |
| @@ -45,6 +46,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 +111,31 @@ 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 permissionNameWithoutDash = permissionName.replace(/-/g, ''); |
| + 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' + |
|
Bernhard Bauer
2014/09/05 08:56:18
At this point it might be easier to either
a) writ
Daniel Nishi
2014/09/05 18:02:39
I've gone with b so we can have the flexibility to
|
| + permissionNameWithoutDash[0].toUpperCase() + |
| + permissionNameWithoutDash.slice(1) + '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, |