| 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 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 false /*isRecent*/, | 30 false /*isRecent*/, |
| 31 print_preview.Destination.ConnectionStatus.ONLINE, | 31 print_preview.Destination.ConnectionStatus.ONLINE, |
| 32 options); | 32 options); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 function PrivetDestinationParser() {} | 35 function PrivetDestinationParser() {} |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * Parses a privet destination as one or more local printers. | 38 * Parses a privet destination as one or more local printers. |
| 39 * @param {!Object} destinationInfo Object that describes a privet printer. | 39 * @param {!Object} destinationInfo Object that describes a privet printer. |
| 40 * @return {!Array.<!print_preview.Destination>} Parsed destination info. | 40 * @return {!Array<!print_preview.Destination>} Parsed destination info. |
| 41 */ | 41 */ |
| 42 PrivetDestinationParser.parse = function(destinationInfo) { | 42 PrivetDestinationParser.parse = function(destinationInfo) { |
| 43 var returnedPrinters = []; | 43 var returnedPrinters = []; |
| 44 | 44 |
| 45 if (destinationInfo.hasLocalPrinting) { | 45 if (destinationInfo.hasLocalPrinting) { |
| 46 returnedPrinters.push(new print_preview.Destination( | 46 returnedPrinters.push(new print_preview.Destination( |
| 47 destinationInfo.serviceName, | 47 destinationInfo.serviceName, |
| 48 print_preview.Destination.Type.LOCAL, | 48 print_preview.Destination.Type.LOCAL, |
| 49 print_preview.Destination.Origin.PRIVET, | 49 print_preview.Destination.Origin.PRIVET, |
| 50 destinationInfo.name, | 50 destinationInfo.name, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 extensionId: destinationInfo.extensionId}); | 86 extensionId: destinationInfo.extensionId}); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 // Export | 89 // Export |
| 90 return { | 90 return { |
| 91 LocalDestinationParser: LocalDestinationParser, | 91 LocalDestinationParser: LocalDestinationParser, |
| 92 PrivetDestinationParser: PrivetDestinationParser, | 92 PrivetDestinationParser: PrivetDestinationParser, |
| 93 ExtensionDestinationParser: ExtensionDestinationParser | 93 ExtensionDestinationParser: ExtensionDestinationParser |
| 94 }; | 94 }; |
| 95 }); | 95 }); |
| OLD | NEW |