OLD | NEW |
---|---|
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 * A data store that stores destinations and dispatches events when the data | 9 * A data store that stores destinations and dispatches events when the data |
10 * store changes. | 10 * store changes. |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
336 * @param {!Object} capabilities Printer capabilities to localize. | 336 * @param {!Object} capabilities Printer capabilities to localize. |
337 * @return {!Object} Localized capabilities. | 337 * @return {!Object} Localized capabilities. |
338 * @private | 338 * @private |
339 */ | 339 */ |
340 DestinationStore.localizeCapabilities_ = function(capabilities) { | 340 DestinationStore.localizeCapabilities_ = function(capabilities) { |
341 var mediaSize = capabilities.printer.media_size; | 341 var mediaSize = capabilities.printer.media_size; |
342 if (mediaSize) { | 342 if (mediaSize) { |
343 var mediaDisplayNames = { | 343 var mediaDisplayNames = { |
344 'ISO_A4': 'A4', | 344 'ISO_A4': 'A4', |
345 'ISO_A3': 'A3', | 345 'ISO_A3': 'A3', |
346 'ISO_A0': 'A0', | |
Aleksey Shlyapnikov
2015/10/19 16:00:27
There's crbug/493830 regarding exposing more media
AlexisBRENON
2015/10/20 08:08:55
Acknowledged.
| |
346 'NA_LETTER': 'Letter', | 347 'NA_LETTER': 'Letter', |
347 'NA_LEGAL': 'Legal', | 348 'NA_LEGAL': 'Legal', |
348 'NA_LEDGER': 'Tabloid' | 349 'NA_LEDGER': 'Tabloid' |
349 }; | 350 }; |
350 for (var i = 0, media; media = mediaSize.option[i]; i++) { | 351 for (var i = 0, media; media = mediaSize.option[i]; i++) { |
351 // No need to patch capabilities with localized names provided. | 352 // No need to patch capabilities with localized names provided. |
352 if (!media.custom_display_name_localized) { | 353 if (!media.custom_display_name_localized) { |
353 media.custom_display_name = | 354 media.custom_display_name = |
354 media.custom_display_name || | 355 media.custom_display_name || |
355 mediaDisplayNames[media.name] || | 356 mediaDisplayNames[media.name] || |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1467 return this.getDestinationKey_( | 1468 return this.getDestinationKey_( |
1468 destination.origin, destination.id, destination.account); | 1469 destination.origin, destination.id, destination.account); |
1469 } | 1470 } |
1470 }; | 1471 }; |
1471 | 1472 |
1472 // Export | 1473 // Export |
1473 return { | 1474 return { |
1474 DestinationStore: DestinationStore | 1475 DestinationStore: DestinationStore |
1475 }; | 1476 }; |
1476 }); | 1477 }); |
OLD | NEW |