Chromium Code Reviews| Index: chrome/browser/resources/print_preview/data/destination_store.js |
| diff --git a/chrome/browser/resources/print_preview/data/destination_store.js b/chrome/browser/resources/print_preview/data/destination_store.js |
| index a52b6d034e2bac20e43daad7120ed99e98533161..c03919337c09132a5f4839b983d9cf9a841c4886 100644 |
| --- a/chrome/browser/resources/print_preview/data/destination_store.js |
| +++ b/chrome/browser/resources/print_preview/data/destination_store.js |
| @@ -169,6 +169,15 @@ cr.define('print_preview', function() { |
| print_preview.DestinationOrigin.CROS : |
| print_preview.DestinationOrigin.LOCAL; |
| + /** |
| + * Whether to default to the system default printer instead of the most |
| + * recent destination. |
| + * @type {boolean} |
|
dpapad
2017/06/19 17:43:37
Nit: @private {boolean}
rbpotter
2017/06/19 23:10:49
Done.
|
| + * @private |
| + */ |
| + this.useSystemDefaultAsDefault_ = |
| + loadTimeData.getBoolean('useSystemDefaultPrinter'); |
| + |
| this.addEventListeners_(); |
| this.reset_(); |
| } |
| @@ -601,11 +610,11 @@ cr.define('print_preview', function() { |
| this.destinationMap_[this.getDestinationKey_(origin, |
| id, account)]; |
| if (candidate != null) { |
| - if (!foundDestination) |
| + if (!foundDestination && !this.useSystemDefaultAsDefault_) |
| this.selectDestination(candidate); |
| candidate.isRecent = true; |
| foundDestination = true; |
| - } else if (!foundDestination) { |
| + } else if (!foundDestination && !this.useSystemDefaultAsDefault_) { |
| foundDestination = this.fetchPreselectedDestination_( |
| origin, |
| id, |
| @@ -617,7 +626,7 @@ cr.define('print_preview', function() { |
| } |
| } |
| } |
| - if (foundDestination) return; |
| + if (foundDestination && !this.useSystemDefaultAsDefault_) return; |
| // Try the system default |
| id = this.systemDefaultDestinationId_ || ''; |