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

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

Issue 7864029: Fix crash in extension settings when trying to enable/disable a crashed extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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/options/extension_list.js
===================================================================
--- chrome/browser/resources/options/extension_list.js (revision 100667)
+++ chrome/browser/resources/options/extension_list.js (working copy)
@@ -184,6 +184,16 @@
version.textContent = extension.version;
vbox.appendChild(version);
+ // And the additional info label (unpacked/crashed).
+ if (extension.terminated || extension.isUnpacked) {
+ var version = this.ownerDocument.createElement('span');
+ version.classList.add('extension-version');
+ version.textContent = extension.terminated ?
+ localStrings.getString('extensionSettingsCrashMessage') :
+ localStrings.getString('extensionSettingsInDevelopment');
+ vbox.appendChild(version);
+ }
+
div = this.ownerDocument.createElement('div');
vbox.appendChild(div);
@@ -231,38 +241,51 @@
section.classList.add('extension-enabling');
div.appendChild(section);
- // The Enable checkbox.
- var input = this.ownerDocument.createElement('input');
- input.addEventListener('click', this.handleEnable_.bind(this));
- input.type = 'checkbox';
- input.name = 'toggle-' + id;
- if (!extension.mayDisable)
- input.disabled = true;
- if (extension.enabled)
- input.checked = true;
- input.id = 'toggle-' + id;
- section.appendChild(input);
- var label = this.ownerDocument.createElement('label');
- label.classList.add('extension-enabling-label');
- if (extension.enabled)
- label.classList.add('extension-enabling-label-bold');
- label.setAttribute('for', 'toggle-' + id);
- label.id = 'toggle-' + id + '-label';
- if (extension.enabled) {
- // Enabled (with a d).
- label.textContent =
- localStrings.getString('extensionSettingsEnabled');
+ if (!extension.terminated) {
+ // The Enable checkbox.
+ var input = this.ownerDocument.createElement('input');
+ input.addEventListener('click', this.handleEnable_.bind(this));
+ input.type = 'checkbox';
+ input.name = 'toggle-' + id;
+ if (!extension.mayDisable)
+ input.disabled = true;
+ if (extension.enabled)
+ input.checked = true;
+ input.id = 'toggle-' + id;
+ section.appendChild(input);
+ var label = this.ownerDocument.createElement('label');
+ label.classList.add('extension-enabling-label');
+ if (extension.enabled)
+ label.classList.add('extension-enabling-label-bold');
+ label.setAttribute('for', 'toggle-' + id);
+ label.id = 'toggle-' + id + '-label';
+ if (extension.enabled) {
+ // Enabled (with a d).
+ label.textContent =
+ localStrings.getString('extensionSettingsEnabled');
+ } else {
+ // Enable (no d).
+ label.textContent =
+ localStrings.getString('extensionSettingsEnable');
+ }
+ section.appendChild(label);
+
+ if (label.offsetWidth > maxCheckboxWidth)
+ maxCheckboxWidth = label.offsetWidth;
+ if (label.offsetWidth < minCheckboxWidth)
+ minCheckboxWidth = label.offsetWidth;
} else {
- // Enable (no d).
- label.textContent = localStrings.getString('extensionSettingsEnable');
+ // Extension has been terminated, show a Reload link.
+ var link = this.ownerDocument.createElement('a');
+ link.classList.add('extension-links-trailing');
+ link.id = extension.id;
+ link.textContent =
+ localStrings.getString('extensionSettingsReload');
+ link.href = '#';
+ link.addEventListener('click', this.handleReload_.bind(this));
+ section.appendChild(link);
}
- section.appendChild(label);
- if (label.offsetWidth > maxCheckboxWidth)
- maxCheckboxWidth = label.offsetWidth;
- if (label.offsetWidth < minCheckboxWidth)
- minCheckboxWidth = label.offsetWidth;
-
// And, on the far right we have the uninstall button.
var button = this.ownerDocument.createElement('button');
button.classList.add('extension-delete');

Powered by Google App Engine
This is Rietveld 408576698