Index: chrome/browser/resources/print_preview/data/invitation_store.js |
diff --git a/chrome/browser/resources/print_preview/data/invitation_store.js b/chrome/browser/resources/print_preview/data/invitation_store.js |
index aeebd25658ef2e1233a23b3427d449dbd66437a3..375b50629ce4b04ece89967172083c99e72aac6d 100644 |
--- a/chrome/browser/resources/print_preview/data/invitation_store.js |
+++ b/chrome/browser/resources/print_preview/data/invitation_store.js |
@@ -2,6 +2,17 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+cr.exportPath('print_preview'); |
+ |
+/** |
+ * @enum {number} |
+ */ |
+print_preview.InvitationStoreLoadStatus = { |
dpapad
2017/05/05 17:32:50
This enum was marked as private before. Can we sti
rbpotter
2017/05/05 18:25:46
Done.
|
+ IN_PROGRESS: 1, |
+ DONE: 2, |
+ FAILED: 3 |
+}; |
+ |
cr.define('print_preview', function() { |
'use strict'; |
@@ -29,7 +40,7 @@ cr.define('print_preview', function() { |
/** |
* Maps user account to the flag whether the invitations for this account |
* were successfully loaded. |
- * @private {!Object<print_preview.InvitationStore.LoadStatus_>} |
+ * @private {!Object<print_preview.InvitationStoreLoadStatus>} |
*/ |
this.loadStatus_ = {}; |
@@ -41,7 +52,7 @@ cr.define('print_preview', function() { |
/** |
* Used to fetch and process invitations. |
- * @private {print_preview.CloudPrintInterface} |
+ * @private {cloudprint.CloudPrintInterface} |
*/ |
this.cloudPrintInterface_ = null; |
@@ -51,7 +62,7 @@ cr.define('print_preview', function() { |
* @private {print_preview.Invitation} |
*/ |
this.invitationInProgress_ = null; |
- }; |
+ } |
/** |
* Event types dispatched by the data store. |
@@ -64,16 +75,6 @@ cr.define('print_preview', function() { |
'print_preview.InvitationStore.INVITATION_SEARCH_DONE' |
}; |
- /** |
- * @enum {number} |
- * @private |
- */ |
- InvitationStore.LoadStatus_ = { |
- IN_PROGRESS: 1, |
- DONE: 2, |
- FAILED: 3 |
- }; |
- |
InvitationStore.prototype = { |
__proto__: cr.EventTarget.prototype, |
@@ -96,7 +97,7 @@ cr.define('print_preview', function() { |
/** |
* Sets the invitation store's Google Cloud Print interface. |
- * @param {!print_preview.CloudPrintInterface} cloudPrintInterface Interface |
+ * @param {!cloudprint.CloudPrintInterface} cloudPrintInterface Interface |
* to set. |
*/ |
setCloudPrintInterface: function(cloudPrintInterface) { |
@@ -127,7 +128,7 @@ cr.define('print_preview', function() { |
return; |
if (this.loadStatus_.hasOwnProperty(this.userInfo_.activeUser)) { |
if (this.loadStatus_[this.userInfo_.activeUser] == |
- InvitationStore.LoadStatus_.DONE) { |
+ print_preview.InvitationStoreLoadStatus.DONE) { |
cr.dispatchSimpleEvent( |
this, InvitationStore.EventType.INVITATION_SEARCH_DONE); |
} |
@@ -135,7 +136,7 @@ cr.define('print_preview', function() { |
} |
this.loadStatus_[this.userInfo_.activeUser] = |
- InvitationStore.LoadStatus_.IN_PROGRESS; |
+ print_preview.InvitationStoreLoadStatus.IN_PROGRESS; |
this.cloudPrintInterface_.invites(this.userInfo_.activeUser); |
}, |
@@ -145,7 +146,7 @@ cr.define('print_preview', function() { |
* @param {boolean} accept Whether to accept this invitation. |
*/ |
processInvitation: function(invitation, accept) { |
- if (!!this.invitationInProgress_) |
+ if (this.invitationInProgress_) |
return; |
this.invitationInProgress_ = invitation; |
this.cloudPrintInterface_.processInvite(invitation, accept); |
@@ -173,7 +174,8 @@ cr.define('print_preview', function() { |
* @private |
*/ |
onCloudPrintInvitesDone_: function(event) { |
- this.loadStatus_[event.user] = InvitationStore.LoadStatus_.DONE; |
+ this.loadStatus_[event.user] = |
+ print_preview.InvitationStoreLoadStatus.DONE; |
this.invitations_[event.user] = event.invitations; |
cr.dispatchSimpleEvent( |
@@ -186,7 +188,8 @@ cr.define('print_preview', function() { |
* @private |
*/ |
onCloudPrintInvitesFailed_: function(event) { |
- this.loadStatus_[event.user] = InvitationStore.LoadStatus_.FAILED; |
+ this.loadStatus_[event.user] = |
+ print_preview.InvitationStoreLoadStatus.FAILED; |
}, |
/** |