| Index: chrome/browser/resources/print_preview/data/local_parsers.js
|
| diff --git a/chrome/browser/resources/print_preview/data/local_parsers.js b/chrome/browser/resources/print_preview/data/local_parsers.js
|
| index f6b4c734958bcf4dc26f824270ccf1bbd039cb46..0759c0fc5812df3e8cb52e6c5d74e78d6dcaf217 100644
|
| --- a/chrome/browser/resources/print_preview/data/local_parsers.js
|
| +++ b/chrome/browser/resources/print_preview/data/local_parsers.js
|
| @@ -6,7 +6,7 @@ cr.define('print_preview', function() {
|
| 'use strict';
|
|
|
| /** Namespace that contains a method to parse local print destinations. */
|
| - function LocalDestinationParser() {};
|
| + function LocalDestinationParser(){};
|
|
|
| /**
|
| * Parses a local print destination.
|
| @@ -18,17 +18,15 @@ cr.define('print_preview', function() {
|
| var options = {'description': destinationInfo.printerDescription};
|
| if (destinationInfo.printerOptions) {
|
| // Convert options into cloud print tags format.
|
| - options.tags = Object.keys(destinationInfo.printerOptions).map(
|
| - function(key) {return '__cp__' + key + '=' + this[key];},
|
| - destinationInfo.printerOptions);
|
| + options.tags =
|
| + Object.keys(destinationInfo.printerOptions).map(function(key) {
|
| + return '__cp__' + key + '=' + this[key];
|
| + }, destinationInfo.printerOptions);
|
| }
|
| return new print_preview.Destination(
|
| - destinationInfo.deviceName,
|
| - print_preview.Destination.Type.LOCAL,
|
| - print_preview.Destination.Origin.LOCAL,
|
| - destinationInfo.printerName,
|
| - false /*isRecent*/,
|
| - print_preview.Destination.ConnectionStatus.ONLINE,
|
| + destinationInfo.deviceName, print_preview.Destination.Type.LOCAL,
|
| + print_preview.Destination.Origin.LOCAL, destinationInfo.printerName,
|
| + false /*isRecent*/, print_preview.Destination.ConnectionStatus.ONLINE,
|
| options);
|
| };
|
|
|
| @@ -43,22 +41,17 @@ cr.define('print_preview', function() {
|
| var returnedPrinters = [];
|
|
|
| if (destinationInfo.hasLocalPrinting) {
|
| - returnedPrinters.push(new print_preview.Destination(
|
| - destinationInfo.serviceName,
|
| - print_preview.Destination.Type.LOCAL,
|
| - print_preview.Destination.Origin.PRIVET,
|
| - destinationInfo.name,
|
| - false /*isRecent*/,
|
| - print_preview.Destination.ConnectionStatus.ONLINE,
|
| - { cloudID: destinationInfo.cloudID }));
|
| + returnedPrinters.push(new print_preview.Destination(
|
| + destinationInfo.serviceName, print_preview.Destination.Type.LOCAL,
|
| + print_preview.Destination.Origin.PRIVET, destinationInfo.name,
|
| + false /*isRecent*/, print_preview.Destination.ConnectionStatus.ONLINE,
|
| + {cloudID: destinationInfo.cloudID}));
|
| }
|
|
|
| if (destinationInfo.isUnregistered) {
|
| returnedPrinters.push(new print_preview.Destination(
|
| - destinationInfo.serviceName,
|
| - print_preview.Destination.Type.GOOGLE,
|
| - print_preview.Destination.Origin.PRIVET,
|
| - destinationInfo.name,
|
| + destinationInfo.serviceName, print_preview.Destination.Type.GOOGLE,
|
| + print_preview.Destination.Origin.PRIVET, destinationInfo.name,
|
| false /*isRecent*/,
|
| print_preview.Destination.ConnectionStatus.UNREGISTERED));
|
| }
|
| @@ -75,22 +68,20 @@ cr.define('print_preview', function() {
|
| * @return {!print_preview.Destination} Parsed destination.
|
| */
|
| ExtensionDestinationParser.parse = function(destinationInfo) {
|
| - var provisionalType =
|
| - destinationInfo.provisional ?
|
| - print_preview.Destination.ProvisionalType.NEEDS_USB_PERMISSION :
|
| - print_preview.Destination.ProvisionalType.NONE;
|
| + var provisionalType = destinationInfo.provisional ?
|
| + print_preview.Destination.ProvisionalType.NEEDS_USB_PERMISSION :
|
| + print_preview.Destination.ProvisionalType.NONE;
|
|
|
| return new print_preview.Destination(
|
| - destinationInfo.id,
|
| - print_preview.Destination.Type.LOCAL,
|
| - print_preview.Destination.Origin.EXTENSION,
|
| - destinationInfo.name,
|
| - false /* isRecent */,
|
| - print_preview.Destination.ConnectionStatus.ONLINE,
|
| - {description: destinationInfo.description || '',
|
| - extensionId: destinationInfo.extensionId,
|
| - extensionName: destinationInfo.extensionName || '',
|
| - provisionalType: provisionalType});
|
| + destinationInfo.id, print_preview.Destination.Type.LOCAL,
|
| + print_preview.Destination.Origin.EXTENSION, destinationInfo.name,
|
| + false /* isRecent */, print_preview.Destination.ConnectionStatus.ONLINE,
|
| + {
|
| + description: destinationInfo.description || '',
|
| + extensionId: destinationInfo.extensionId,
|
| + extensionName: destinationInfo.extensionName || '',
|
| + provisionalType: provisionalType
|
| + });
|
| };
|
|
|
| // Export
|
|
|