| 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 20 matching lines...) Expand all Loading... |
| 31 destinationInfo.printerName, | 31 destinationInfo.printerName, |
| 32 false /*isRecent*/, | 32 false /*isRecent*/, |
| 33 print_preview.DestinationConnectionStatus.ONLINE, | 33 print_preview.DestinationConnectionStatus.ONLINE, |
| 34 options); | 34 options); |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 function PrivetDestinationParser() {} | 37 function PrivetDestinationParser() {} |
| 38 | 38 |
| 39 /** | 39 /** |
| 40 * Parses a privet destination as one or more local printers. | 40 * Parses a privet destination as one or more local printers. |
| 41 * @param {!Object} destinationInfo Object that describes a privet printer. | 41 * @param {!print_preview.PrivetPrinterDescription} destinationInfo Object |
| 42 * that describes a privet printer. |
| 42 * @return {!Array<!print_preview.Destination>} Parsed destination info. | 43 * @return {!Array<!print_preview.Destination>} Parsed destination info. |
| 43 */ | 44 */ |
| 44 PrivetDestinationParser.parse = function(destinationInfo) { | 45 PrivetDestinationParser.parse = function(destinationInfo) { |
| 45 var returnedPrinters = []; | 46 var returnedPrinters = []; |
| 46 | 47 |
| 47 if (destinationInfo.hasLocalPrinting) { | 48 if (destinationInfo.hasLocalPrinting) { |
| 48 returnedPrinters.push(new print_preview.Destination( | 49 returnedPrinters.push(new print_preview.Destination( |
| 49 destinationInfo.serviceName, | 50 destinationInfo.serviceName, |
| 50 print_preview.DestinationType.LOCAL, | 51 print_preview.DestinationType.LOCAL, |
| 51 print_preview.DestinationOrigin.PRIVET, | 52 print_preview.DestinationOrigin.PRIVET, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 provisionalType: provisionalType}); | 96 provisionalType: provisionalType}); |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 // Export | 99 // Export |
| 99 return { | 100 return { |
| 100 LocalDestinationParser: LocalDestinationParser, | 101 LocalDestinationParser: LocalDestinationParser, |
| 101 PrivetDestinationParser: PrivetDestinationParser, | 102 PrivetDestinationParser: PrivetDestinationParser, |
| 102 ExtensionDestinationParser: ExtensionDestinationParser | 103 ExtensionDestinationParser: ExtensionDestinationParser |
| 103 }; | 104 }; |
| 104 }); | 105 }); |
| OLD | NEW |