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

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: Kalman's 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 0b919eb93db8b1340b81878e7913d7c982cd587e..4b1ce70076b8fd7eca8009211344d3788433ccab 100644
--- a/chrome/browser/resources/extensions/extension_list.js
+++ b/chrome/browser/resources/extensions/extension_list.js
@@ -232,6 +232,14 @@ cr.define('options', function() {
focusGrid_: new cr.ui.FocusGrid(),
/**
+ * Indicates whether an uninstall dialog is being shown to prevent multiple
+ * dialogs from being displayed.
+ * @type {boolean}
+ * @private
+ */
+ uninstallIsShowing_: false,
+
+ /**
* Necessary to only show the butterbar once.
* @private {boolean}
*/
@@ -449,8 +457,16 @@ cr.define('options', function() {
trash.hidden = extension.managedInstall;
trash.setAttribute('column-type', 'trash');
trash.addEventListener('click', function(e) {
- chrome.send('extensionSettingsUninstall', [extension.id]);
- });
+ if (this.uninstallIsShowing_)
+ return;
+ this.uninstallIsShowing_ = true;
+ chrome.management.uninstall(extension.id,
+ {showConfirmDialog: true},
+ function() {
+ // TODO(devlin): What should we do if the uninstall fails?
+ this.uninstallIsShowing_ = false;
+ }.bind(this));
+ }.bind(this));
row.querySelector('.enable-controls').appendChild(trash);
// Developer mode ////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698