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

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/commandbutton.js

Issue 651403002: Fix trivial type-check errors in file_manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and correct a comment. Created 6 years, 2 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: ui/file_manager/file_manager/foreground/js/ui/commandbutton.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/commandbutton.js b/ui/file_manager/file_manager/foreground/js/ui/commandbutton.js
index 6e5606ee9fa346b9e94035821c523b17c74c9e73..88543c1fa4409dda86447720c90b3a59d7af8e80 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/commandbutton.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/commandbutton.js
@@ -12,7 +12,7 @@
* Creates a new button element.
* @param {Object=} opt_propertyBag Optional properties.
* @constructor
- * @extends {HTMLDivElement}
+ * @extends {HTMLButtonElement}
*/
var CommandButton = cr.ui.define('button');
@@ -21,7 +21,7 @@ CommandButton.prototype.__proto__ = HTMLButtonElement.prototype;
/**
* Associated command.
- * @type {Command}
+ * @type {cr.ui.Command}
* @private
*/
CommandButton.prototype.command_ = null;
@@ -52,13 +52,17 @@ CommandButton.prototype.getCommand = function() {
*/
CommandButton.prototype.setCommand = function(command) {
if (this.command_) {
- this.command_.removeEventListener('labelChange', this);
- this.command_.removeEventListener('disabledChange', this);
- this.command_.removeEventListener('hiddenChange', this);
+ this.command_.removeEventListener('labelChange',
+ /** @type {EventListener} */ (this));
+ this.command_.removeEventListener('disabledChange',
+ /** @type {EventListener} */ (this));
+ this.command_.removeEventListener('hiddenChange',
+ /** @type {EventListener} */ (this));
}
if (typeof command == 'string' && command[0] == '#') {
- command = this.ownerDocument.getElementById(command.slice(1));
+ command = /** @type {!cr.ui.Command} */
+ (this.ownerDocument.getElementById(command.slice(1)));
cr.ui.decorate(command, cr.ui.Command);
}
@@ -71,9 +75,12 @@ CommandButton.prototype.setCommand = function(command) {
this.disabled = command.disabled;
this.hidden = command.hidden;
- this.command_.addEventListener('labelChange', this);
- this.command_.addEventListener('disabledChange', this);
- this.command_.addEventListener('hiddenChange', this);
+ this.command_.addEventListener('labelChange',
+ /** @type {EventListener} */ (this));
+ this.command_.addEventListener('disabledChange',
+ /** @type {EventListener} */ (this));
+ this.command_.addEventListener('hiddenChange',
+ /** @type {EventListener} */ (this));
}
};

Powered by Google App Engine
This is Rietveld 408576698