| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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.exportPath('print_preview'); | 5 cr.exportPath('print_preview'); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @enum {number} | 8 * @enum {number} |
| 9 * @private | 9 * @private |
| 10 */ | 10 */ |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 invitations: function(account) { | 94 invitations: function(account) { |
| 95 return this.invitations_[account] || []; | 95 return this.invitations_[account] || []; |
| 96 }, | 96 }, |
| 97 | 97 |
| 98 /** | 98 /** |
| 99 * Sets the invitation store's Google Cloud Print interface. | 99 * Sets the invitation store's Google Cloud Print interface. |
| 100 * @param {!cloudprint.CloudPrintInterface} cloudPrintInterface Interface | 100 * @param {!cloudprint.CloudPrintInterface} cloudPrintInterface Interface |
| 101 * to set. | 101 * to set. |
| 102 */ | 102 */ |
| 103 setCloudPrintInterface: function(cloudPrintInterface) { | 103 setCloudPrintInterface: function(cloudPrintInterface) { |
| 104 assert(this.cloudPrintInterface_ == null); |
| 104 this.cloudPrintInterface_ = cloudPrintInterface; | 105 this.cloudPrintInterface_ = cloudPrintInterface; |
| 105 this.tracker_.add( | 106 this.tracker_.add( |
| 106 this.cloudPrintInterface_, | 107 this.cloudPrintInterface_, |
| 107 cloudprint.CloudPrintInterfaceEventType.INVITES_DONE, | 108 cloudprint.CloudPrintInterfaceEventType.INVITES_DONE, |
| 108 this.onCloudPrintInvitesDone_.bind(this)); | 109 this.onCloudPrintInvitesDone_.bind(this)); |
| 109 this.tracker_.add( | 110 this.tracker_.add( |
| 110 this.cloudPrintInterface_, | 111 this.cloudPrintInterface_, |
| 111 cloudprint.CloudPrintInterfaceEventType.INVITES_FAILED, | 112 cloudprint.CloudPrintInterfaceEventType.INVITES_FAILED, |
| 112 this.onCloudPrintInvitesDone_.bind(this)); | 113 this.onCloudPrintInvitesDone_.bind(this)); |
| 113 this.tracker_.add( | 114 this.tracker_.add( |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 this.invitationProcessed_(event.invitation); | 216 this.invitationProcessed_(event.invitation); |
| 216 // TODO: Display an error. | 217 // TODO: Display an error. |
| 217 cr.dispatchSimpleEvent( | 218 cr.dispatchSimpleEvent( |
| 218 this, InvitationStore.EventType.INVITATION_PROCESSED); | 219 this, InvitationStore.EventType.INVITATION_PROCESSED); |
| 219 } | 220 } |
| 220 }; | 221 }; |
| 221 | 222 |
| 222 // Export | 223 // Export |
| 223 return {InvitationStore: InvitationStore}; | 224 return {InvitationStore: InvitationStore}; |
| 224 }); | 225 }); |
| OLD | NEW |