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

Unified Diff: ui/webui/resources/js/cr/ui/command.js

Issue 454223004: Typecheck JS files for chrome://history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@B_download
Patch Set: right rebase, switched to gyp Created 6 years, 4 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/webui/resources/js/cr/ui/command.js
diff --git a/ui/webui/resources/js/cr/ui/command.js b/ui/webui/resources/js/cr/ui/command.js
index e06cd6857725b6b299f9cef8bff7b93184f7640a..fe92bec91c489828bc4c0fbed9ddb3e352dcbfe5 100644
--- a/ui/webui/resources/js/cr/ui/command.js
+++ b/ui/webui/resources/js/cr/ui/command.js
@@ -78,7 +78,7 @@ cr.define('cr.ui', function() {
* Initializes the command.
*/
decorate: function() {
- CommandManager.init(this.ownerDocument);
+ CommandManager.init(/** @type {!Document} */(this.ownerDocument));
Dan Beam 2014/08/19 00:31:53 i'd just say assert(this.ownerDocument) instead as
Vitaly Pavlenko 2014/08/19 18:30:27 Done.
if (this.hasAttribute('shortcut'))
this.shortcut = this.getAttribute('shortcut');
@@ -163,25 +163,21 @@ cr.define('cr.ui', function() {
/**
* The label of the command.
- * @type {string}
*/
cr.defineProperty(Command, 'label', cr.PropertyKind.ATTR);
/**
* Whether the command is disabled or not.
- * @type {boolean}
*/
cr.defineProperty(Command, 'disabled', cr.PropertyKind.BOOL_ATTR);
/**
* Whether the command is hidden or not.
- * @type {boolean}
*/
cr.defineProperty(Command, 'hidden', cr.PropertyKind.BOOL_ATTR);
/**
* Whether the command is checked or not.
- * @type {boolean}
*/
cr.defineProperty(Command, 'checked', cr.PropertyKind.BOOL_ATTR);
@@ -191,18 +187,16 @@ cr.define('cr.ui', function() {
* If false, the keyboard shortcut text (eg. "Ctrl+X" for the cut command)
* is displayed in menu when the command is assosiated with a menu item.
* Otherwise, no text is displayed.
- *
- * @type {boolean}
*/
cr.defineProperty(Command, 'hideShortcutText', cr.PropertyKind.BOOL_ATTR);
/**
* Dispatches a canExecute event on the target.
- * @param {cr.ui.Command} command The command that we are testing for.
- * @param {Element} target The target element to dispatch the event on.
+ * @param {!cr.ui.Command} command The command that we are testing for.
+ * @param {EventTarget} target The target element to dispatch the event on.
*/
function dispatchCanExecuteEvent(command, target) {
- var e = new CanExecuteEvent(command, true);
+ var e = new CanExecuteEvent(command);
target.dispatchEvent(e);
command.disabled = !e.canExecute;
}

Powered by Google App Engine
This is Rietveld 408576698