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

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: Add helper 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..fb5b95530dac70f9043aca234423a7a6c1c78f43 100644
--- a/chrome/browser/resources/print_preview/data/app_state.js
+++ b/chrome/browser/resources/print_preview/data/app_state.js
@@ -125,73 +125,13 @@ cr.define('print_preview', function() {
AppState.NATIVE_FUNCTION_NAME_ = 'saveAppState';
AppState.prototype = {
-
- /**
- * Helper function to get the most recent destination.
- * @return {?RecentDestination} The most recent value of the
- * destination.
- */
- getSelectedDestination_: function() {
- return (this.state_[AppState.Field.RECENT_DESTINATIONS].length > 0) ?
- this.state_[AppState.Field.RECENT_DESTINATIONS][0] : null;
- },
-
- /** @return {?string} ID of the selected destination. */
- get selectedDestinationId() {
- 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 {?print_preview.Destination.Origin<string>} Origin of the
- * selected destination.
- */
- get selectedDestinationOrigin() {
- 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 {?string} Name of the selected destination. */
- get selectedDestinationName() {
- 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 {?string} Extension name associated with the selected
- * destination.
- */
- get selectedDestinationExtensionName() {
- return this.getSelectedDestination_ ?
- this.getSelectedDestination_.extensionName : null;
- },
-
/**
* @return {?RecentDestination} The most recent destination, which is
* currently the selected destination.
*/
get selectedDestination() {
- return this.getSelectedDestination_;
+ return (this.state_[AppState.Field.RECENT_DESTINATIONS].length > 0) ?
+ this.state_[AppState.Field.RECENT_DESTINATIONS][0] : null;
},
/**

Powered by Google App Engine
This is Rietveld 408576698