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

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

Issue 1105683003: [Extensions Page] Add a listener on extension list for "hasExtensions" changing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « chrome/browser/resources/extensions/extension_list.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/extensions/extensions.js
diff --git a/chrome/browser/resources/extensions/extensions.js b/chrome/browser/resources/extensions/extensions.js
index e094312bba88eb769323613216a95ca2a3c30158..48dfa5d5495d0190474538ef9bc847d08ef0a090 100644
--- a/chrome/browser/resources/extensions/extensions.js
+++ b/chrome/browser/resources/extensions/extensions.js
@@ -98,6 +98,8 @@ cr.define('extensions', function() {
/**
* ExtensionSettings class
* @class
+ * @constructor
+ * @implements {extensions.ExtensionListDelegate}
*/
function ExtensionSettings() {}
@@ -133,7 +135,7 @@ cr.define('extensions', function() {
// Set the title.
uber.setTitle(loadTimeData.getString('extensionSettings'));
- var extensionList = new ExtensionList();
+ var extensionList = new ExtensionList(this);
extensionList.id = 'extension-settings-list';
var wrapper = $('extension-list-wrapper');
wrapper.insertBefore(extensionList, wrapper.firstChild);
@@ -274,10 +276,7 @@ cr.define('extensions', function() {
document.documentElement.classList.remove('loading');
}, 0);
- /** @const */
- var hasExtensions = extensionList.getNumExtensions() != 0;
- $('no-extensions').hidden = hasExtensions;
- $('extension-list-wrapper').hidden = !hasExtensions;
+ this.onExtensionCountChanged();
}.bind(this));
},
@@ -293,10 +292,9 @@ cr.define('extensions', function() {
/**
* Shows the Extension Commands configuration UI.
- * @param {Event} e Change event.
* @private
*/
- showExtensionCommandsConfigUi_: function(e) {
+ showExtensionCommandsConfigUi_: function() {
ExtensionSettings.showOverlay($('extension-commands-overlay'));
chrome.send('metricsHandler:recordAction',
['Options_ExtensionCommands']);
@@ -347,8 +345,20 @@ cr.define('extensions', function() {
buttons.offsetHeight + 'px';
}.bind(this));
},
+
+ /** @override */
+ onExtensionCountChanged: function() {
+ /** @const */
+ var hasExtensions = $('extension-settings-list').getNumExtensions() != 0;
+ $('no-extensions').hidden = hasExtensions;
+ $('extension-list-wrapper').hidden = !hasExtensions;
+ },
};
+ /**
+ * Called by the WebUI when something has changed and the extensions UI needs
+ * to be updated.
+ */
ExtensionSettings.onExtensionsChanged = function() {
ExtensionSettings.getInstance().update_();
};
« no previous file with comments | « chrome/browser/resources/extensions/extension_list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698