Chromium Code Reviews| Index: chrome/browser/resources/extensions/extension_list.js |
| diff --git a/chrome/browser/resources/extensions/extension_list.js b/chrome/browser/resources/extensions/extension_list.js |
| index 008a990754a24175ea472eb453f2ebfa7f616932..040b71de7d54eed1f1d4b1d18569deaea3e0346c 100644 |
| --- a/chrome/browser/resources/extensions/extension_list.js |
| +++ b/chrome/browser/resources/extensions/extension_list.js |
| @@ -98,6 +98,14 @@ cr.define('options', function() { |
| optionsShown_: false, |
| /** |
| + * Indicates whether an uninstall dialog is being shown to prevent multiple |
| + * dialogs from being displayed. |
| + * @type {boolean} |
| + * @private |
| + */ |
| + uninstallShown_: false, |
| + |
| + /** |
| * Necessary to only show the butterbar once. |
| * @private {boolean} |
| */ |
| @@ -288,8 +296,16 @@ cr.define('options', function() { |
| var trash = trashTemplate.cloneNode(true); |
| trash.title = loadTimeData.getString('extensionUninstall'); |
| trash.addEventListener('click', function(e) { |
| - chrome.send('extensionSettingsUninstall', [extension.id]); |
| - }); |
| + if (this.uninstallShown_) |
| + return; |
| + this.uninstallShown_ = true; |
|
not at google - send to devlin
2015/02/25 21:37:57
uninstallIsShowing would be better, Shown could me
Devlin
2015/02/25 23:12:47
Called it uninstallShown to match, e.g., optionsSh
not at google - send to devlin
2015/02/25 23:55:58
Should be optionsIsShowing :P
Devlin
2015/02/26 00:19:54
haha yeah, it should.
|
| + // TODO(devlin): What should we do if the uninstall fails? |
|
not at google - send to devlin
2015/02/25 21:37:57
TODO belongs in the callback body.
Devlin
2015/02/25 23:12:47
Done.
|
| + chrome.management.uninstall(extension.id, |
| + {showConfirmDialog: true}, |
| + function() { |
| + this.uninstallShown_ = false; |
| + }.bind(this)); |
| + }.bind(this)); |
| node.querySelector('.enable-controls').appendChild(trash); |
| // Developer mode //////////////////////////////////////////////////////// |