| Index: chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js
|
| diff --git a/chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js b/chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js
|
| index bb974601a1d95058aa71e225f33324efc616e6a2..310dbbb8c960165dae056cc6cc033afa14c851a2 100644
|
| --- a/chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js
|
| +++ b/chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js
|
| @@ -2,6 +2,11 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +/**
|
| + * @typedef {Object|number|boolean|string}
|
| + */
|
| +print_preview.ValueType;
|
| +
|
| cr.define('print_preview.ticket_items', function() {
|
| 'use strict';
|
|
|
| @@ -10,21 +15,21 @@ cr.define('print_preview.ticket_items', function() {
|
| * ticket item has a value which can be set by the user. Ticket items can also
|
| * be unavailable for modifying if the print destination doesn't support it or
|
| * if other ticket item constraints are not met.
|
| - * @param {print_preview.AppState=} appState Application state model to update
|
| + * @param {?print_preview.AppState} appState Application state model to update
|
| * when ticket items update.
|
| - * @param {print_preview.AppState.Field=} field Field of the app state to
|
| + * @param {?print_preview.AppState.Field} field Field of the app state to
|
| * update when ticket item is updated.
|
| - * @param {print_preview.DestinationStore=} destinationStore Used listen for
|
| + * @param {?print_preview.DestinationStore} destinationStore Used listen for
|
| * changes in the currently selected destination's capabilities. Since
|
| * this is a common dependency of ticket items, it's handled in the base
|
| * class.
|
| - * @param {print_preview.DocumentInfo=} documentInfo Used to listen for
|
| + * @param {?print_preview.DocumentInfo=} opt_documentInfo Used to listen for
|
| * changes in the document. Since this is a common dependency of ticket
|
| * items, it's handled in the base class.
|
| * @constructor
|
| * @extends {cr.EventTarget}
|
| */
|
| - function TicketItem(appState, field, destinationStore, documentInfo) {
|
| + function TicketItem(appState, field, destinationStore, opt_documentInfo) {
|
| cr.EventTarget.call(this);
|
|
|
| /**
|
| @@ -54,7 +59,7 @@ cr.define('print_preview.ticket_items', function() {
|
| * @type {print_preview.DocumentInfo}
|
| * @private
|
| */
|
| - this.documentInfo_ = documentInfo || null;
|
| + this.documentInfo_ = opt_documentInfo || null;
|
|
|
| /**
|
| * Backing store of the print ticket item.
|
| @@ -86,7 +91,7 @@ cr.define('print_preview.ticket_items', function() {
|
|
|
| /**
|
| * Determines whether a given value is valid for the ticket item.
|
| - * @param {Object} value The value to check for validity.
|
| + * @param {print_preview.ValueType} value The value to check for validity.
|
| * @return {boolean} Whether the given value is valid for the ticket item.
|
| */
|
| wouldValueBeValid: function(value) {
|
| @@ -127,7 +132,8 @@ cr.define('print_preview.ticket_items', function() {
|
| },
|
|
|
| /**
|
| - * @param {Object} value Value to compare to the value of this ticket item.
|
| + * @param {print_preview.ValueType} value Value to compare to the value of
|
| + * this ticket item.
|
| * @return {boolean} Whether the given value is equal to the value of the
|
| * ticket item.
|
| */
|
| @@ -135,7 +141,10 @@ cr.define('print_preview.ticket_items', function() {
|
| return this.getValue() == value;
|
| },
|
|
|
| - /** @param {!Object} value Value to set as the value of the ticket item. */
|
| + /**
|
| + * @param {print_preview.ValueType} value Value to set as the value of the
|
| + * ticket item.
|
| + */
|
| updateValue: function(value) {
|
| // Use comparison with capabilities for event.
|
| var sendUpdateEvent = !this.isValueEqual(value);
|
|
|