| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 /** | 334 /** |
| 335 * Localizes printer capabilities. | 335 * Localizes printer capabilities. |
| 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_A0': 'A0', |
| 345 'ISO_A1': 'A1', |
| 346 'ISO_A2': 'A2', |
| 347 'ISO_A3': 'A3', |
| 344 'ISO_A4': 'A4', | 348 'ISO_A4': 'A4', |
| 345 'ISO_A3': 'A3', | 349 'ISO_A5': 'A5', |
| 350 'NA_LEGAL': 'Legal', |
| 346 'NA_LETTER': 'Letter', | 351 'NA_LETTER': 'Letter', |
| 347 'NA_LEGAL': 'Legal', | 352 'NA_LEDGER': 'Tabloid', |
| 348 'NA_LEDGER': 'Tabloid' | 353 'OM_UK_BUSINESS_CARD': 'UK Business card', |
| 354 'OM_US_BUSINESS_CARD': 'US Business card' |
| 349 }; | 355 }; |
| 350 for (var i = 0, media; media = mediaSize.option[i]; i++) { | 356 for (var i = 0, media; media = mediaSize.option[i]; i++) { |
| 351 // No need to patch capabilities with localized names provided. | 357 // No need to patch capabilities with localized names provided. |
| 352 if (!media.custom_display_name_localized) { | 358 if (!media.custom_display_name_localized) { |
| 353 media.custom_display_name = | 359 media.custom_display_name = |
| 354 media.custom_display_name || | 360 media.custom_display_name || |
| 355 mediaDisplayNames[media.name] || | 361 mediaDisplayNames[media.name] || |
| 356 media.name; | 362 media.name; |
| 357 } | 363 } |
| 358 } | 364 } |
| (...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 return this.getDestinationKey_( | 1473 return this.getDestinationKey_( |
| 1468 destination.origin, destination.id, destination.account); | 1474 destination.origin, destination.id, destination.account); |
| 1469 } | 1475 } |
| 1470 }; | 1476 }; |
| 1471 | 1477 |
| 1472 // Export | 1478 // Export |
| 1473 return { | 1479 return { |
| 1474 DestinationStore: DestinationStore | 1480 DestinationStore: DestinationStore |
| 1475 }; | 1481 }; |
| 1476 }); | 1482 }); |
| OLD | NEW |