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

Side by Side Diff: chrome/browser/resources/print_preview/data/cloud_capabilities.js

Issue 10450022: Print Preview Print Destination Search Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Set --bary flag Created 8 years, 6 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 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Capabilities of a cloud-based print destination. 9 * Capabilities of a cloud-based print destination.
10 * @param {print_preview.CollateCapability} collateCapability Print 10 * @param {print_preview.CollateCapability} collateCapability Print
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 * duplexing capability. 104 * duplexing capability.
105 */ 105 */
106 get duplexCapability() { 106 get duplexCapability() {
107 return this.duplexCapability_; 107 return this.duplexCapability_;
108 } 108 }
109 }; 109 };
110 110
111 /** 111 /**
112 * A single print capability of a cloud-based print destination. 112 * A single print capability of a cloud-based print destination.
113 * @param {string} id Identifier of the capability. 113 * @param {string} id Identifier of the capability.
114 * @param {print_preview.CloudCapability.Type} type Type of the capability. 114 * @param {!print_preview.CloudCapability.Type} type Type of the capability.
115 * @constructor 115 * @constructor
116 */ 116 */
117 function CloudCapability(id, type) { 117 function CloudCapability(id, type) {
118 /** 118 /**
119 * Identifier of the capability. 119 * Identifier of the capability.
120 * @type {string} 120 * @type {string}
121 * @private 121 * @private
122 */ 122 */
123 this.id_ = id; 123 this.id_ = id;
124 124
125 /** 125 /**
126 * Type of the capability. 126 * Type of the capability.
127 * @type {print_preview.CloudCapability.Type} 127 * @type {!print_preview.CloudCapability.Type}
128 * @private 128 * @private
129 */ 129 */
130 this.type_ = type; 130 this.type_ = type;
131 }; 131 };
132 132
133 /** 133 /**
134 * Enumeration of the types of cloud-based print capabilities. 134 * Enumeration of the types of cloud-based print capabilities.
135 * @enum {string} 135 * @enum {string}
136 */ 136 */
137 CloudCapability.Type = { 137 CloudCapability.Type = {
138 FEATURE: 'Feature', 138 FEATURE: 'Feature',
139 PARAMETER_DEF: 'ParameterDef' 139 PARAMETER_DEF: 'ParameterDef'
140 }; 140 };
141 141
142 CloudCapability.prototype = { 142 CloudCapability.prototype = {
143 /** @return {string} Identifier of the capability. */ 143 /** @return {string} Identifier of the capability. */
144 get id() { 144 get id() {
145 return this.id_; 145 return this.id_;
146 }, 146 },
147 147
148 /** @return {print_preview.CloudCapability.Type} Type of the capability. */ 148 /** @return {!print_preview.CloudCapability.Type} Type of the capability. */
149 get type() { 149 get type() {
150 return this.type_; 150 return this.type_;
151 } 151 }
152 }; 152 };
153 153
154 /** 154 /**
155 * Cloud-based collate capability. 155 * Cloud-based collate capability.
156 * @param {string} id Identifier of the collate capability. 156 * @param {string} id Identifier of the collate capability.
157 * @param {string} collateOption Identifier of the option that enables 157 * @param {string} collateOption Identifier of the option that enables
158 * collation. 158 * collation.
(...skipping 24 matching lines...) Expand all
183 /** 183 /**
184 * Whether collation is enabled by default. 184 * Whether collation is enabled by default.
185 * @type {boolean} 185 * @type {boolean}
186 * @private 186 * @private
187 */ 187 */
188 this.isCollateDefault_ = isCollateDefault; 188 this.isCollateDefault_ = isCollateDefault;
189 }; 189 };
190 190
191 /** 191 /**
192 * Mapping of capability formats to an identifier of the collate capability. 192 * Mapping of capability formats to an identifier of the collate capability.
193 * @type {object<CloudCapabilities.Format, string>} 193 * @type {!Object.<!CloudCapabilities.Format, string>}
194 */ 194 */
195 CollateCapability.Id = {}; 195 CollateCapability.Id = {};
196 CollateCapability.Id[CloudCapabilities.Format.PPD] = 'Collate'; 196 CollateCapability.Id[CloudCapabilities.Format.PPD] = 'Collate';
197 CollateCapability.Id[CloudCapabilities.Format.XPS] = 'psk:DocumentCollate'; 197 CollateCapability.Id[CloudCapabilities.Format.XPS] = 'psk:DocumentCollate';
198 198
199 /** 199 /**
200 * Regular expression that matches a collate option. 200 * Regular expression that matches a collate option.
201 * @type {!RegExp} 201 * @type {!RegExp}
202 * @const 202 * @const
203 */ 203 */
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 /** 257 /**
258 * Whether to print in color by default. 258 * Whether to print in color by default.
259 * @type {boolean} 259 * @type {boolean}
260 * @private 260 * @private
261 */ 261 */
262 this.isColorDefault_ = isColorDefault; 262 this.isColorDefault_ = isColorDefault;
263 }; 263 };
264 264
265 /** 265 /**
266 * Mapping of capability formats to an identifier of the color capability. 266 * Mapping of capability formats to an identifier of the color capability.
267 * @type {object<CloudCapabilities.Format, string>} 267 * @type {!Object.<!CloudCapabilities.Format, string>}
268 */ 268 */
269 ColorCapability.Id = {}; 269 ColorCapability.Id = {};
270 ColorCapability.Id[CloudCapabilities.Format.HP] = 'ns1:Colors'; 270 ColorCapability.Id[CloudCapabilities.Format.HP] = 'ns1:Colors';
271 ColorCapability.Id[CloudCapabilities.Format.PPD] = 'ColorModel'; 271 ColorCapability.Id[CloudCapabilities.Format.PPD] = 'ColorModel';
272 ColorCapability.Id[CloudCapabilities.Format.XPS] = 'psk:PageOutputColor'; 272 ColorCapability.Id[CloudCapabilities.Format.XPS] = 'psk:PageOutputColor';
273 273
274 /** 274 /**
275 * Regular expression that matches a color option. 275 * Regular expression that matches a color option.
276 * @type {!RegExp} 276 * @type {!RegExp}
277 * @const 277 * @const
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 function CopiesCapability(id) { 312 function CopiesCapability(id) {
313 CloudCapability.call(this, id, CloudCapability.Type.PARAMETER_DEF); 313 CloudCapability.call(this, id, CloudCapability.Type.PARAMETER_DEF);
314 }; 314 };
315 315
316 CopiesCapability.prototype = { 316 CopiesCapability.prototype = {
317 __proto__: CloudCapability.prototype 317 __proto__: CloudCapability.prototype
318 }; 318 };
319 319
320 /** 320 /**
321 * Mapping of capability formats to an identifier of the copies capability. 321 * Mapping of capability formats to an identifier of the copies capability.
322 * @type {object<CloudCapabilities.Format, string>} 322 * @type {!Object.<!CloudCapabilities.Format, string>}
323 */ 323 */
324 CopiesCapability.Id = {}; 324 CopiesCapability.Id = {};
325 CopiesCapability.Id[CloudCapabilities.Format.XPS] = 325 CopiesCapability.Id[CloudCapabilities.Format.XPS] =
326 'psk:JobCopiesAllDocuments'; 326 'psk:JobCopiesAllDocuments';
327 327
328 /** 328 /**
329 * Cloud-based duplex print capability. 329 * Cloud-based duplex print capability.
330 * @param {string} id Identifier of the duplex capability. 330 * @param {string} id Identifier of the duplex capability.
331 * @param {string} simplexOption Identifier of the no-duplexing option. 331 * @param {string} simplexOption Identifier of the no-duplexing option.
332 * @param {string} longEdgeOption Identifier of the duplex on long edge 332 * @param {string} longEdgeOption Identifier of the duplex on long edge
(...skipping 22 matching lines...) Expand all
355 /** 355 /**
356 * Whether duplexing is enabled by default. 356 * Whether duplexing is enabled by default.
357 * @type {boolean} 357 * @type {boolean}
358 * @private 358 * @private
359 */ 359 */
360 this.isDuplexDefault_ = isDuplexDefault; 360 this.isDuplexDefault_ = isDuplexDefault;
361 }; 361 };
362 362
363 /** 363 /**
364 * Mapping of capability formats to an identifier of the duplex capability. 364 * Mapping of capability formats to an identifier of the duplex capability.
365 * @type {object<CloudCapabilities.Format, string>} 365 * @type {!Object.<!CloudCapabilities.Format, string>}
366 */ 366 */
367 DuplexCapability.Id = {}; 367 DuplexCapability.Id = {};
368 DuplexCapability.Id[CloudCapabilities.Format.PPD] = 'Duplex'; 368 DuplexCapability.Id[CloudCapabilities.Format.PPD] = 'Duplex';
369 DuplexCapability.Id[CloudCapabilities.Format.XPS] = 369 DuplexCapability.Id[CloudCapabilities.Format.XPS] =
370 'psk:JobDuplexAllDocumentsContiguously'; 370 'psk:JobDuplexAllDocumentsContiguously';
371 371
372 /** 372 /**
373 * Regular expression that matches a no-duplexing option. 373 * Regular expression that matches a no-duplexing option.
374 * @type {!RegExp} 374 * @type {!RegExp}
375 * @const 375 * @const
(...skipping 28 matching lines...) Expand all
404 404
405 // Export 405 // Export
406 return { 406 return {
407 CloudCapabilities: CloudCapabilities, 407 CloudCapabilities: CloudCapabilities,
408 CollateCapability: CollateCapability, 408 CollateCapability: CollateCapability,
409 ColorCapability: ColorCapability, 409 ColorCapability: ColorCapability,
410 CopiesCapability: CopiesCapability, 410 CopiesCapability: CopiesCapability,
411 DuplexCapability: DuplexCapability 411 DuplexCapability: DuplexCapability
412 }; 412 };
413 }); 413 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698