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

Side by Side Diff: chrome/browser/resources/print_preview/print_preview_utils.js

Issue 606213002: Compile print_preview, part 6: reduce down to 48 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@J_print_preview_5
Patch Set: vitalybuka@'s review 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @param {string} toTest The string to be tested. 6 * @param {string} toTest The string to be tested.
7 * @return {boolean} True if |toTest| contains only digits. Leading and trailing 7 * @return {boolean} True if |toTest| contains only digits. Leading and trailing
8 * whitespace is allowed. 8 * whitespace is allowed.
9 */ 9 */
10 function isInteger(toTest) { 10 function isInteger(toTest) {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 /** 136 /**
137 * Returns a list of pages defined by |pagesRangeText|. The pages are 137 * Returns a list of pages defined by |pagesRangeText|. The pages are
138 * listed in the order they appear in |pageRangeText| and duplicates are not 138 * listed in the order they appear in |pageRangeText| and duplicates are not
139 * eliminated. If |pageRangeText| is not valid according or 139 * eliminated. If |pageRangeText| is not valid according or
140 * |totalPageCount| undefined [1,2,...,totalPageCount] is returned. 140 * |totalPageCount| undefined [1,2,...,totalPageCount] is returned.
141 * See pageRangeTextToPageRanges for details. 141 * See pageRangeTextToPageRanges for details.
142 * @param {string} pageRangeText The text to be checked. 142 * @param {string} pageRangeText The text to be checked.
143 * @param {number} totalPageCount The total number of pages. 143 * @param {number} totalPageCount The total number of pages.
144 * @return {Array.<number>} A list of all pages. 144 * @return {!Array.<number>} A list of all pages.
145 */ 145 */
146 function pageRangeTextToPageList(pageRangeText, totalPageCount) { 146 function pageRangeTextToPageList(pageRangeText, totalPageCount) {
147 var pageRanges = pageRangeTextToPageRanges(pageRangeText, totalPageCount); 147 var pageRanges = pageRangeTextToPageRanges(pageRangeText, totalPageCount);
148 var pageList = []; 148 var pageList = [];
149 if (pageRanges) { 149 if (pageRanges) {
150 for (var i = 0; i < pageRanges.length; ++i) { 150 for (var i = 0; i < pageRanges.length; ++i) {
151 for (var j = pageRanges[i].from; j <= Math.min(pageRanges[i].to, 151 for (var j = pageRanges[i].from; j <= Math.min(pageRanges[i].to,
152 totalPageCount); ++j) { 152 totalPageCount); ++j) {
153 pageList.push(j); 153 pageList.push(j);
154 } 154 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 197
198 /** 198 /**
199 * @param {!Array} array Array to check for item. 199 * @param {!Array} array Array to check for item.
200 * @param {*} item Item to look for in array. 200 * @param {*} item Item to look for in array.
201 * @return {boolean} Whether the item is in the array. 201 * @return {boolean} Whether the item is in the array.
202 */ 202 */
203 function arrayContains(array, item) { 203 function arrayContains(array, item) {
204 return array.indexOf(item) != -1; 204 return array.indexOf(item) != -1;
205 } 205 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698