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

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

Issue 233623003: Remember and restore the account last used destination is registered for. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adjust PrintPreview unit test. Created 6 years, 8 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/print_preview.js
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js
index ee2f46dad09722b6bd83698ed5043ec376836116..712e5cc5793146c89105431c8ebc565509f92d63 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -785,6 +785,7 @@ cr.define('print_preview', function() {
if (e.keyCode == 13 /*enter*/ &&
!this.destinationSearch_.getIsVisible() &&
+ this.destinationStore_.selectedDestination &&
this.printTicketStore_.isTicketValid()) {
assert(this.uiState_ == PrintPreview.UiState_.READY,
'Trying to print when not in ready state: ' + this.uiState_);
@@ -899,9 +900,10 @@ cr.define('print_preview', function() {
*/
onDestinationSelect_: function() {
var selectedDest = this.destinationStore_.selectedDestination;
- setIsVisible($('cloud-print-dialog-link'),
- !cr.isChromeOS && !selectedDest.isLocal);
- if (this.isInKioskAutoPrintMode_) {
+ setIsVisible(
+ $('cloud-print-dialog-link'),
+ selectedDest && !cr.isChromeOS && !selectedDest.isLocal);
+ if (selectedDest && this.isInKioskAutoPrintMode_) {
this.onPrintButtonClick_();
}
},

Powered by Google App Engine
This is Rietveld 408576698