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

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

Issue 2516523002: Fix CrOS reverting to Save as PDF and random PDF preview fail (Closed)
Patch Set: Created 4 years, 1 month 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/app_state.js
diff --git a/chrome/browser/resources/print_preview/data/app_state.js b/chrome/browser/resources/print_preview/data/app_state.js
index eeeb2da53b6c52b7054a97b9cda4042d8e9eb394..1554407f13f39d3e277a06d319bad036667e9359 100644
--- a/chrome/browser/resources/print_preview/data/app_state.js
+++ b/chrome/browser/resources/print_preview/data/app_state.js
@@ -138,14 +138,14 @@ cr.define('print_preview', function() {
/** @return {?string} ID of the selected destination. */
get selectedDestinationId() {
dpapad 2016/11/18 00:33:20 I am also wondering why are all these getters (lin
rbpotter 2016/11/18 02:59:22 Done. They were here because they were here before
- return this.getSelectedDestination_ ?
- this.getSelectedDestination_.id : null;
+ return this.getSelectedDestination_() ?
+ this.getSelectedDestination_().id : null;
},
/** @return {?string} Account the selected destination is registered for. */
get selectedDestinationAccount() {
- return this.getSelectedDestination_ ?
- this.getSelectedDestination_.account : null;
+ return this.getSelectedDestination_() ?
+ this.getSelectedDestination_().account : null;
},
/**
@@ -153,28 +153,28 @@ cr.define('print_preview', function() {
* selected destination.
*/
get selectedDestinationOrigin() {
- return this.getSelectedDestination_ ?
- this.getSelectedDestination_.origin : null;
+ return this.getSelectedDestination_() ?
+ this.getSelectedDestination_().origin : null;
},
/** @return {?print_preview.Cdd} CDD of the selected destination. */
get selectedDestinationCapabilities() {
- return this.getSelectedDestination_ ?
- this.getSelectedDestination_.capabilities : null;
+ return this.getSelectedDestination_() ?
+ this.getSelectedDestination_().capabilities : null;
},
/** @return {?string} Name of the selected destination. */
get selectedDestinationName() {
- return this.getSelectedDestination_ ?
- this.getSelectedDestination_.name : null;
+ return this.getSelectedDestination_() ?
+ this.getSelectedDestination_().name : null;
},
/**
* @return {?string} Extension ID associated with the selected destination.
*/
get selectedDestinationExtensionId() {
- return this.getSelectedDestination_ ?
- this.getSelectedDestination_.extensionId : null;
+ return this.getSelectedDestination_() ?
+ this.getSelectedDestination_().extensionId : null;
},
/**
@@ -182,8 +182,8 @@ cr.define('print_preview', function() {
* destination.
*/
get selectedDestinationExtensionName() {
- return this.getSelectedDestination_ ?
- this.getSelectedDestination_.extensionName : null;
+ return this.getSelectedDestination_() ?
+ this.getSelectedDestination_().extensionName : null;
},
/**
@@ -191,7 +191,7 @@ cr.define('print_preview', function() {
* currently the selected destination.
*/
get selectedDestination() {
- return this.getSelectedDestination_;
+ return this.getSelectedDestination_();
},
/**
@@ -299,7 +299,7 @@ cr.define('print_preview', function() {
* @param {!print_preview.Destination} dest Destination to persist.
*/
persistSelectedDestination: function(dest) {
- if (!this.isInitialized_)
+ if (!this.isInitialized_ || !dest)
dpapad 2016/11/18 00:33:20 Also per the type annotation !print_preview.Destin
rbpotter 2016/11/18 02:59:23 Removed this and updated the place it was getting
return;
// Determine if this destination is already in the recent destinations,

Powered by Google App Engine
This is Rietveld 408576698