| 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 /** Namespace that contains a method to parse local print destinations. */ | 8 /** Namespace that contains a method to parse local print destinations. */ |
| 9 function LocalDestinationParser() {}; | 9 function LocalDestinationParser() {}; |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * Parses a local print destination. | 12 * Parses a local print destination. |
| 13 * @param {!Object} destinationInfo Information describing a local print | 13 * @param {!Object} destinationInfo Information describing a local print |
| 14 * destination. | 14 * destination. |
| 15 * @return {!print_preview.Destination} Parsed local print destination. | 15 * @return {!print_preview.Destination} Parsed local print destination. |
| 16 */ | 16 */ |
| 17 LocalDestinationParser.parse = function(destinationInfo) { | 17 LocalDestinationParser.parse = function(destinationInfo) { |
| 18 return new print_preview.Destination( | 18 return new print_preview.Destination( |
| 19 destinationInfo.deviceName, | 19 destinationInfo.deviceName, |
| 20 print_preview.Destination.Type.LOCAL, | 20 print_preview.Destination.Type.LOCAL, |
| 21 print_preview.Destination.AuthType.LOCAL, | 21 print_preview.Destination.Origin.LOCAL, |
| 22 destinationInfo.printerName, | 22 destinationInfo.printerName, |
| 23 false /*isRecent*/, | 23 false /*isRecent*/, |
| 24 print_preview.Destination.ConnectionStatus.ONLINE); | 24 print_preview.Destination.ConnectionStatus.ONLINE); |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 /** Namespace that contains a method to parse local print capabilities. */ | 27 /** Namespace that contains a method to parse local print capabilities. */ |
| 28 function LocalCapabilitiesParser() {}; | 28 function LocalCapabilitiesParser() {}; |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * Parses local print capabilities. | 31 * Parses local print capabilities. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 62 hasColorCapability, | 62 hasColorCapability, |
| 63 defaultIsColorEnabled); | 63 defaultIsColorEnabled); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 // Export | 66 // Export |
| 67 return { | 67 return { |
| 68 LocalCapabilitiesParser: LocalCapabilitiesParser, | 68 LocalCapabilitiesParser: LocalCapabilitiesParser, |
| 69 LocalDestinationParser: LocalDestinationParser | 69 LocalDestinationParser: LocalDestinationParser |
| 70 }; | 70 }; |
| 71 }); | 71 }); |
| OLD | NEW |