Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1177)

Unified Diff: chrome/browser/resources/print_preview/data/invitation_store.js

Issue 2862203002: Print Preview: Fix data/ errors (Closed)
Patch Set: Make tests pass Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
},
/**

Powered by Google App Engine
This is Rietveld 408576698