| Index: chrome/browser/resources/print_preview/data/cloud_parsers.js
|
| diff --git a/chrome/browser/resources/print_preview/data/cloud_parsers.js b/chrome/browser/resources/print_preview/data/cloud_parsers.js
|
| index d4d032e4c4e4e5632cf4da945b4bbfd1f3d9ed92..756b3e6bf9e232f59f62841864a80a6596ac8587 100644
|
| --- a/chrome/browser/resources/print_preview/data/cloud_parsers.js
|
| +++ b/chrome/browser/resources/print_preview/data/cloud_parsers.js
|
| @@ -6,7 +6,7 @@ cr.define('cloudprint', function() {
|
| 'use strict';
|
|
|
| /** Namespace which contains a method to parse cloud destinations directly. */
|
| - function CloudDestinationParser() {};
|
| + function CloudDestinationParser(){};
|
|
|
| /**
|
| * Enumeration of cloud destination field names.
|
| @@ -78,24 +78,23 @@ cr.define('cloudprint', function() {
|
| account: account,
|
| tags: tags,
|
| isOwned: arrayContains(tags, CloudDestinationParser.OWNED_TAG_),
|
| - lastAccessTime: parseInt(
|
| - json[CloudDestinationParser.Field_.LAST_ACCESS], 10) || Date.now(),
|
| + lastAccessTime:
|
| + parseInt(json[CloudDestinationParser.Field_.LAST_ACCESS], 10) ||
|
| + Date.now(),
|
| isTosAccepted: (id == print_preview.Destination.GooglePromotedId.FEDEX) ?
|
| - json[CloudDestinationParser.Field_.IS_TOS_ACCEPTED] : null,
|
| + json[CloudDestinationParser.Field_.IS_TOS_ACCEPTED] :
|
| + null,
|
| cloudID: id,
|
| description: json[CloudDestinationParser.Field_.DESCRIPTION]
|
| };
|
| var cloudDest = new print_preview.Destination(
|
| - id,
|
| - CloudDestinationParser.parseType_(
|
| - json[CloudDestinationParser.Field_.TYPE]),
|
| - origin,
|
| - json[CloudDestinationParser.Field_.DISPLAY_NAME],
|
| + id, CloudDestinationParser.parseType_(
|
| + json[CloudDestinationParser.Field_.TYPE]),
|
| + origin, json[CloudDestinationParser.Field_.DISPLAY_NAME],
|
| arrayContains(tags, CloudDestinationParser.RECENT_TAG_) /*isRecent*/,
|
| - connectionStatus,
|
| - optionalParams);
|
| + connectionStatus, optionalParams);
|
| if (json.hasOwnProperty(CloudDestinationParser.Field_.CAPABILITIES)) {
|
| - cloudDest.capabilities = /** @type {!print_preview.Cdd} */(
|
| + cloudDest.capabilities = /** @type {!print_preview.Cdd} */ (
|
| json[CloudDestinationParser.Field_.CAPABILITIES]);
|
| }
|
| return cloudDest;
|
| @@ -120,7 +119,7 @@ cr.define('cloudprint', function() {
|
| };
|
|
|
| /** Namespace which contains a method to parse printer sharing invitation. */
|
| - function InvitationParser() {};
|
| + function InvitationParser(){};
|
|
|
| /**
|
| * Enumeration of invitation field names.
|
| @@ -138,12 +137,8 @@ cr.define('cloudprint', function() {
|
| * @enum {string}
|
| * @private
|
| */
|
| - InvitationParser.AclType_ = {
|
| - DOMAIN: 'DOMAIN',
|
| - GROUP: 'GROUP',
|
| - PUBLIC: 'PUBLIC',
|
| - USER: 'USER'
|
| - };
|
| + InvitationParser.AclType_ =
|
| + {DOMAIN: 'DOMAIN', GROUP: 'GROUP', PUBLIC: 'PUBLIC', USER: 'USER'};
|
|
|
| /**
|
| * Parses printer sharing invitation from JSON from GCP invite API response.
|
| @@ -170,8 +165,9 @@ cr.define('cloudprint', function() {
|
| var receiverType = receiver['type'];
|
| if (receiverType == InvitationParser.AclType_.USER) {
|
| // It's a personal invitation, empty name indicates just that.
|
| - } else if (receiverType == InvitationParser.AclType_.GROUP ||
|
| - receiverType == InvitationParser.AclType_.DOMAIN) {
|
| + } else if (
|
| + receiverType == InvitationParser.AclType_.GROUP ||
|
| + receiverType == InvitationParser.AclType_.DOMAIN) {
|
| receiverName = nameFormatter(receiver['name'], receiver['scope']);
|
| } else {
|
| throw Error('Invitation of unsupported receiver type');
|
| @@ -179,8 +175,7 @@ cr.define('cloudprint', function() {
|
|
|
| var destination = cloudprint.CloudDestinationParser.parse(
|
| json[InvitationParser.Field_.PRINTER],
|
| - print_preview.Destination.Origin.COOKIES,
|
| - account);
|
| + print_preview.Destination.Origin.COOKIES, account);
|
|
|
| return new print_preview.Invitation(
|
| senderName, receiverName, destination, receiver, account);
|
|
|