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

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

Issue 948413005: [Extensions] Make chrome://extensions use management.uninstall (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 ////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698