Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / chrome / browser / resources / print_preview / data / invitation.js
blobfdd46615f0f85d2f6f46cc4a028e66311abcfc5a
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 cr.define('print_preview', function() {
6 'use strict';
8 /**
9 * Printer sharing invitation data object.
10 * @param {string} sender Text identifying invitation sender.
11 * @param {string} receiver Text identifying invitation receiver. Empty in
12 * case of a personal invitation. Identifies a group or domain in case
13 * of an invitation received by a group manager.
14 * @param {!print_preview.Destination} destination Shared destination.
15 * @param {!Object} aclEntry JSON representation of the ACL entry this
16 * invitation was sent to.
17 * @param {string} account User account this invitation is sent for.
18 * @constructor
20 function Invitation(sender, receiver, destination, aclEntry, account) {
21 /**
22 * Text identifying invitation sender.
23 * @private {string}
25 this.sender_ = sender;
27 /**
28 * Text identifying invitation receiver. Empty in case of a personal
29 * invitation. Identifies a group or domain in case of an invitation
30 * received by a group manager.
31 * @private {string}
33 this.receiver_ = receiver;
35 /**
36 * Shared destination.
37 * @private {!print_preview.Destination}
39 this.destination_ = destination;
41 /**
42 * JSON representation of the ACL entry this invitation was sent to.
43 * @private {!Object}
45 this.aclEntry_ = aclEntry;
47 /**
48 * Account this invitation is sent for.
49 * @private {string}
51 this.account_ = account;
54 Invitation.prototype = {
55 /** @return {string} Text identifying invitation sender. */
56 get sender() {
57 return this.sender_;
60 /** @return {string} Text identifying invitation receiver. */
61 get receiver() {
62 return this.receiver_;
65 /**
66 * @return {boolean} Whether this user acts as a manager for a group of
67 * users.
69 get asGroupManager() {
70 return !!this.receiver_;
73 /** @return {!print_preview.Destination} Shared destination. */
74 get destination() {
75 return this.destination_;
78 /** @return {string} Scope (account) this invitation was sent to. */
79 get scopeId() {
80 return this.aclEntry_['scope'] || '';
83 /** @return {string} Account this invitation is sent for. */
84 get account() {
85 return this.account_;
89 // Export
90 return {
91 Invitation: Invitation
93 });