Commit f3777e5f authored by vitalyp's avatar vitalyp Committed by Commit bot

Compile print_preview, part 1: remove all warnings

R=dbeam@chromium.org
BUG=393873
TEST=GYP_GENERATORS=ninja gyp --depth . chrome/browser/resources/print_preview/compiled_resources.gyp && ninja -C out/Default | grep WARNING

Review URL: https://codereview.chromium.org/574193002

Cr-Commit-Position: refs/heads/master@{#296016}
parent 33913132
......@@ -49,7 +49,7 @@ PDFScriptingAPI.prototype = {
* Send a message to the extension. If we try to send messages prior to the
* extension being ready to receive messages (i.e. before it has finished
* loading) we queue up the messages and flush them later.
* @param {Object} the message to send.
* @param {Object} message The message to send.
*/
sendMessage_: function(message) {
if (!this.pdfWindow_) {
......
......@@ -519,7 +519,7 @@ cr.define('cloudprint', function() {
/**
* Called when a native layer receives access token.
* @param {Event} evt Contains the authentication type and access token.
* @param {Event} event Contains the authentication type and access token.
* @private
*/
onAccessTokenReady_: function(event) {
......
......@@ -51,7 +51,7 @@ cr.define('print_preview', function() {
SearchBox.prototype = {
__proto__: print_preview.Component.prototype,
/** @param {string} New query to set the search box's query to. */
/** @param {string} query New query to set the search box's query to. */
setQuery: function(query) {
query = query || '';
this.input_.value = query.trim();
......
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'print_preview',
'variables': {
'depends': [
'../../../../ui/webui/resources/js/cr.js',
'../../../../ui/webui/resources/js/cr/event_target.js',
'../../../../ui/webui/resources/js/cr/ui.js',
'../../../../ui/webui/resources/js/cr/ui/focus_manager.js',
'../../../../ui/webui/resources/js/cr/ui/focus_outline_manager.js',
'../../../../ui/webui/resources/js/event_tracker.js',
'../../../../ui/webui/resources/js/i18n_template.js',
'../../../../ui/webui/resources/js/local_strings.js',
'../../../../ui/webui/resources/js/util.js',
],
'externs': ['<(CLOSURE_DIR)/externs/chrome_send_externs.js'],
},
'includes': ['../../../../third_party/closure_compiler/compile_js.gypi'],
}
],
}
......@@ -24,7 +24,10 @@ cr.define('print_preview', function() {
return this.capabilities_;
},
/** @param {!print_preview.Cdd} New instance to put into the holder. */
/**
* @param {!print_preview.Cdd} capabilities New instance to put into the
* holder.
*/
set: function(capabilities) {
this.capabilities_ = capabilities;
}
......
......@@ -95,7 +95,7 @@ cr.define('cloudprint', function() {
connectionStatus,
optionalParams);
if (json.hasOwnProperty(CloudDestinationParser.Field_.CAPABILITIES)) {
cloudDest.capabilities = /*@type {!print_preview.Cdd}*/ (
cloudDest.capabilities = /** @type {!print_preview.Cdd} */(
json[CloudDestinationParser.Field_.CAPABILITIES]);
}
return cloudDest;
......
......@@ -400,9 +400,9 @@ cr.define('print_preview', function() {
},
/**
* @param {?boolean} Whether the user has accepted the terms-of-service of
* the print destination or {@code null} if a terms-of-service does not
* apply.
* @param {?boolean} isTosAccepted Whether the user has accepted the
* terms-of-service of the print destination or {@code null} if
* a terms-of-service does not apply.
*/
set isTosAccepted(isTosAccepted) {
this.isTosAccepted_ = isTosAccepted;
......
......@@ -383,7 +383,9 @@ cr.define('print_preview', function() {
});
},
/** @param {!print_preview.Destination} Destination to select. */
/**
* @param {!print_preview.Destination} destination Destination to select.
*/
selectDestination: function(destination) {
this.isInAutoSelectMode_ = false;
// When auto select expires, DESTINATION_SELECT event has to be dispatched
......@@ -716,7 +718,7 @@ cr.define('print_preview', function() {
/**
* Called when the local destinations have been got from the native layer.
* @param {Event} Contains the local destinations.
* @param {Event} event Contains the local destinations.
* @private
*/
onLocalDestinationsSet_: function(event) {
......
......@@ -140,7 +140,7 @@ cr.define('print_preview', function() {
},
/**
* @param {number} Value in local units to convert to points.
* @param {number} localUnits Value in local units to convert to points.
* @return {number} Value in points.
*/
convertToPoints: function(localUnits) {
......
......@@ -35,7 +35,7 @@ cr.define('print_preview', function() {
},
/**
* @param {number} 1-based page number to check for.
* @param {number} pageNumber 1-based page number to check for.
* @return {boolean} Whether the given page number is in the page range.
*/
hasPageNumber: function(pageNumber) {
......@@ -43,7 +43,7 @@ cr.define('print_preview', function() {
},
/**
* @param {number} 1-based number of the page to get index of.
* @param {number} pageNumber 1-based number of the page to get index of.
* @return {number} 0-based index of the given page number with respect to
* all of the pages in the page range.
*/
......
......@@ -23,13 +23,13 @@ cr.define('print_preview.ticket_items', function() {
destinationStore);
};
/*
/**
* @private {!Array.<string>} List of capability types considered color.
* @const
*/
Color.COLOR_TYPES_ = ['STANDARD_COLOR', 'CUSTOM_COLOR'];
/*
/**
* @private {!Array.<string>} List of capability types considered monochrome.
* @const
*/
......@@ -114,7 +114,7 @@ cr.define('print_preview.ticket_items', function() {
},
/**
* @param options {!Array.<!Object.<{type: string=, is_default: boolean=}>>
* @param {!Array.<!Object.<{type: string=, is_default: boolean=}>>} options
* @return {Object.<{type: string=, is_default: boolean=}>} Default color
* option of the given list.
* @private
......
......@@ -134,7 +134,7 @@ cr.define('print_preview.ticket_items', function() {
return this.getValue() == value;
},
/** @param {!Object} Value to set as the value of the ticket item. */
/** @param {!Object} 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);
......
......@@ -200,7 +200,7 @@ cr.define('print_preview', function() {
* @param {!print_preview.PrintTicketStore} printTicketStore Used to get the
* state of the print ticket.
* @param {!print_preview.DocumentInfo} documentInfo Document data model.
* @param {number} ID of the preview request.
* @param {number} requestId ID of the preview request.
*/
startGetPreview: function(
destination, printTicketStore, documentInfo, requestId) {
......@@ -435,7 +435,8 @@ cr.define('print_preview', function() {
/**
* Turn on the integration of Cloud Print.
* @param {string} cloudPrintURL The URL to use for cloud print servers.
* @param {{cloudPrintURL: string, appKioskMode: string}} settings
* cloudPrintUrl: The URL to use for cloud print servers.
* @private
*/
onSetUseCloudPrint_: function(settings) {
......@@ -474,7 +475,7 @@ cr.define('print_preview', function() {
/**
* Called when native layer gets settings information for a requested local
* destination.
* @param {string} printerId printer affected by error.
* @param {string} destinationId Printer affected by error.
* @private
*/
onFailedToGetPrinterCapabilities_: function(destinationId) {
......@@ -489,7 +490,7 @@ cr.define('print_preview', function() {
/**
* Called when native layer gets settings information for a requested privet
* destination.
* @param {string} printerId printer affected by error.
* @param {string} destinationId Printer affected by error.
* @private
*/
onFailedToGetPrivetPrinterCapabilities_: function(destinationId) {
......
......@@ -265,7 +265,7 @@ cr.define('print_preview', function() {
/**
* Converts a value in pixels to points.
* @param {number} Pixel value to convert.
* @param {number} pixels Pixel value to convert.
* @return {number} Given value expressed in points.
*/
convertPixelsToPts: function(pixels) {
......
......@@ -153,7 +153,7 @@ cr.define('print_preview', function() {
/**
* Clips margin controls to the given clip size in pixels.
* @param {print_preview.Size} Size to clip the margin controls to.
* @param {print_preview.Size} clipSize Size to clip the margin controls to.
*/
updateClippingMask: function(clipSize) {
if (!clipSize) {
......
......@@ -556,13 +556,6 @@ cr.define('print_preview', function() {
* Called when the open-system-dialog button is clicked. Disables the
* button, shows the throbber, and dispatches the OPEN_SYSTEM_DIALOG_CLICK
* event.
* @param {number} pageX the x-coordinate of the page relative to the
* screen.
* @param {number} pageY the y-coordinate of the page relative to the
* screen.
* @param {number} pageWidth the width of the page on the screen.
* @param {number} viewportWidth the width of the viewport.
* @param {number} viewportHeight the height of the viewport.
* @private
*/
onOpenSystemDialogButtonClick_: function() {
......@@ -594,7 +587,7 @@ cr.define('print_preview', function() {
/**
* Called when the preview generator begins loading the preview.
* @param {Event} Contains the URL to initialize the plugin to.
* @param {Event} event Contains the URL to initialize the plugin to.
* @private
*/
onPreviewStart_: function(event) {
......
......@@ -121,7 +121,8 @@ cr.define('print_preview', function() {
/**
* Gets estimated height of the destination list for the given number of
* items.
* @param {number} Number of items to render in the destination list.
* @param {number} numItems Number of items to render in the destination
* list.
* @return {number} Height (in pixels) of the destination list.
*/
getEstimatedHeightInPixels: function(numItems) {
......
......@@ -49,7 +49,7 @@ cr.define('print_preview', function() {
return this.isAvailable();
},
/** @param {boolean} Whether the component is enabled. */
/** @param {boolean} isEnabled Whether the component is enabled. */
set isEnabled(isEnabled) {
this.getButton_().disabled = !isEnabled;
},
......
......@@ -11,8 +11,6 @@ cr.define('print_preview', function() {
* events to.
* @param {!print_preview.PrintTicketStore} printTicketStore Contains the
* print ticket to print.
* @param {!print_preview.Destination} destination Destination data object to
* render.
* @param {!Object} capability Capability to render.
* @constructor
* @extends {print_preview.Component}
......
......@@ -144,7 +144,7 @@ cr.define('print_preview', function() {
},
/**
* @param {boolean} Whether the custom hint is visible.
* @param {boolean} isVisible Whether the custom hint is visible.
* @private
*/
setInvalidStateVisible_: function(isVisible) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment