Chromium Code Reviews| Index: chrome/browser/resources/print_preview/search/destination_search.js |
| diff --git a/chrome/browser/resources/print_preview/search/destination_search.js b/chrome/browser/resources/print_preview/search/destination_search.js |
| index 94e46fb33b99f414cb70cc11c51d083cde6a8e36..615b686bf38437b9444db7f36be495b9ee9e96be 100644 |
| --- a/chrome/browser/resources/print_preview/search/destination_search.js |
| +++ b/chrome/browser/resources/print_preview/search/destination_search.js |
| @@ -31,7 +31,7 @@ cr.define('print_preview', function() { |
| /** |
| * Data store holding printer sharing invitations. |
| - * @type {!print_preview.DestinationStore} |
| + * @type {!print_preview.InvitationStore} |
| * @private |
| */ |
| this.invitationStore_ = invitationStore; |
| @@ -115,7 +115,7 @@ cr.define('print_preview', function() { |
| */ |
| this.cloudList_ = new print_preview.CloudDestinationList(this); |
| this.addChild(this.cloudList_); |
| - }; |
| + } |
| /** |
| * Event types dispatched by the component. |
| @@ -505,7 +505,7 @@ cr.define('print_preview', function() { |
| }, |
| /** |
| - * @param {!printe_preview.Invitation} invitation Invitation to show. |
| + * @param {!print_preview.Invitation} invitation Invitation to show. |
| * @private |
| */ |
| showInvitation_: function(invitation) { |
| @@ -555,8 +555,8 @@ cr.define('print_preview', function() { |
| option.value = ''; |
| accountSelectEl.add(option); |
| - accountSelectEl.selectedIndex = |
| - this.userInfo_.users.indexOf(this.userInfo_.activeUser); |
| + accountSelectEl.selectedIndex = this.userInfo_.activeUser ? |
|
dpapad
2017/05/08 20:40:10
Is the logic here equivalent to previous logic?
P
rbpotter
2017/05/08 23:28:20
Done.
|
| + this.userInfo_.users.indexOf(this.userInfo_.activeUser) : 0; |
| } |
| setIsVisible(this.getChildElement('.user-info'), loggedIn); |
| @@ -621,7 +621,7 @@ cr.define('print_preview', function() { |
| this.destinationInConfiguring_ = destination; |
| this.destinationStore_.resolveCrosDestination(destination).then( |
| /** |
| - * @param {!print_preview.PrinterSetupResponse} response. |
| + * @param {!print_preview.PrinterSetupResponse} response |
| */ |
| function(response) { |
| this.destinationInConfiguring_ = null; |
| @@ -677,12 +677,13 @@ cr.define('print_preview', function() { |
| }.bind(this)). |
| catch( |
| function() { |
| - console.log('Failed to resolve provisional destination: ' + |
| + console.error('Failed to resolve provisional destination: ' + |
| destination.id); |
| }). |
| then( |
| function() { |
| - this.removeChild(this.provisionalDestinationResolver_); |
| + this.removeChild( |
| + assert(this.provisionalDestinationResolver_)); |
| this.provisionalDestinationResolver_ = null; |
| // Restore focus to the previosly focused element if it's |
| @@ -814,7 +815,8 @@ cr.define('print_preview', function() { |
| this.metrics_.record(accept ? |
| print_preview.Metrics.DestinationSearchBucket.INVITATION_ACCEPTED : |
| print_preview.Metrics.DestinationSearchBucket.INVITATION_REJECTED); |
| - this.invitationStore_.processInvitation(this.invitation_, accept); |
| + if (this.invitation_) |
|
dpapad
2017/05/08 20:40:10
Can this ever be null/undefined here? Can we asser
rbpotter
2017/05/08 23:28:20
I don't think so, as the buttons that trigger it a
|
| + this.invitationStore_.processInvitation(this.invitation_, accept); |
| this.updateInvitations_(); |
| }, |