Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4336)

Unified Diff: chrome/browser/resources/extensions/extension_list.js

Issue 10382149: Refactor the various ways to control what users can do to extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/extensions/extension_list.js
===================================================================
--- chrome/browser/resources/extensions/extension_list.js (revision 140193)
+++ chrome/browser/resources/extensions/extension_list.js (working copy)
@@ -48,8 +48,7 @@
*/
showExtensionNodes_: function() {
// Iterate over the extension data and add each item to the list.
- var list = this;
- this.data_.extensions.forEach(this.createNode_.bind(this));
+ this.data_.extensions.forEach(this.createNode_, this);
if (this.data_.extensions.length == 0)
this.classList.add('empty-extension-list');
@@ -72,7 +71,7 @@
if (!extension.enabled || extension.terminated)
node.classList.add('inactive-extension');
- if (!extension.mayDisable)
+ if (!extension.userModifiable)
node.classList.add('may-not-disable');
var item = node.querySelector('.extension-list-item');
@@ -170,9 +169,9 @@
// The 'Enabled' checkbox.
var enable = node.querySelector('.enable-checkbox');
enable.hidden = false;
- enable.querySelector('input').disabled = !extension.mayDisable;
+ enable.querySelector('input').disabled = !extension.userModifiable;
- if (extension.mayDisable) {
+ if (extension.userModifiable) {
enable.addEventListener('click', function(e) {
chrome.send('extensionSettingsEnable',
[extension.id, e.target.checked ? 'true' : 'false']);
@@ -212,7 +211,7 @@
}
// Then the 'managed, cannot uninstall/disable' message.
- if (!extension.mayDisable)
+ if (!extension.userModifiable)
node.querySelector('.managed-message').hidden = false;
// Then active views.
@@ -266,7 +265,7 @@
}
this.appendChild(node);
- },
+ }
};
return {
« no previous file with comments | « chrome/browser/extensions/test_management_policy.cc ('k') | chrome/browser/ui/views/ash/app_list/extension_app_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698