| 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 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1540 } | 1540 } |
| 1541 } else { | 1541 } else { |
| 1542 if (destination) { | 1542 if (destination) { |
| 1543 // In case there were multiple capabilities request for this local | 1543 // In case there were multiple capabilities request for this local |
| 1544 // destination, just ignore the later ones. | 1544 // destination, just ignore the later ones. |
| 1545 if (destination.capabilities != null) { | 1545 if (destination.capabilities != null) { |
| 1546 return; | 1546 return; |
| 1547 } | 1547 } |
| 1548 destination.capabilities = capabilities; | 1548 destination.capabilities = capabilities; |
| 1549 } else { | 1549 } else { |
| 1550 var printerOptions = null; |
| 1551 if ('cups_enterprise_printer' in event.settingsInfo) { |
| 1552 printerOptions = {'cups_enterprise_printer': |
| 1553 event.settingsInfo['cups_enterprise_printer']}; |
| 1554 } |
| 1555 |
| 1550 destination = print_preview.LocalDestinationParser.parse( | 1556 destination = print_preview.LocalDestinationParser.parse( |
| 1551 {deviceName: destinationId, | 1557 {deviceName: destinationId, |
| 1552 printerName: printerName, | 1558 printerName: printerName, |
| 1553 printerDescription: printerDescription}); | 1559 printerDescription: printerDescription, |
| 1560 printerOptions: printerOptions}); |
| 1554 destination.capabilities = capabilities; | 1561 destination.capabilities = capabilities; |
| 1555 this.insertDestination_(destination); | 1562 this.insertDestination_(destination); |
| 1556 } | 1563 } |
| 1557 } | 1564 } |
| 1558 if (this.selectedDestination_ && | 1565 if (this.selectedDestination_ && |
| 1559 this.selectedDestination_.id == destinationId) { | 1566 this.selectedDestination_.id == destinationId) { |
| 1560 cr.dispatchSimpleEvent( | 1567 cr.dispatchSimpleEvent( |
| 1561 this, | 1568 this, |
| 1562 DestinationStore.EventType.SELECTED_DESTINATION_CAPABILITIES_READY); | 1569 DestinationStore.EventType.SELECTED_DESTINATION_CAPABILITIES_READY); |
| 1563 } | 1570 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1745 return this.getDestinationKey_( | 1752 return this.getDestinationKey_( |
| 1746 destination.origin, destination.id, destination.account); | 1753 destination.origin, destination.id, destination.account); |
| 1747 } | 1754 } |
| 1748 }; | 1755 }; |
| 1749 | 1756 |
| 1750 // Export | 1757 // Export |
| 1751 return { | 1758 return { |
| 1752 DestinationStore: DestinationStore | 1759 DestinationStore: DestinationStore |
| 1753 }; | 1760 }; |
| 1754 }); | 1761 }); |
| OLD | NEW |