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

Side by Side Diff: chrome/browser/resources/print_preview/data/app_state.js

Issue 606213002: Compile print_preview, part 6: reduce down to 48 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@J_print_preview_5
Patch Set: vitalybuka@'s review Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Object used to get and persist the print preview application state. 9 * Object used to get and persist the print preview application state.
10 * @constructor 10 * @constructor
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 /** 128 /**
129 * Initializes the app state from a serialized string returned by the native 129 * Initializes the app state from a serialized string returned by the native
130 * layer. 130 * layer.
131 * @param {?string} serializedAppStateStr Serialized string representation 131 * @param {?string} serializedAppStateStr Serialized string representation
132 * of the app state. 132 * of the app state.
133 * @param {?string} systemDefaultDestinationId ID of the system default 133 * @param {?string} systemDefaultDestinationId ID of the system default
134 * destination. 134 * destination.
135 */ 135 */
136 init: function(serializedAppStateStr, systemDefaultDestinationId) { 136 init: function(serializedAppStateStr, systemDefaultDestinationId) {
137 if (serializedAppStateStr) { 137 if (serializedAppStateStr) {
138 var state = JSON.parse(serializedAppStateStr); 138 var state = /** @type {Object.<string, ?>} */(
139 JSON.parse(serializedAppStateStr));
139 if (state[AppState.Field.VERSION] == AppState.VERSION_) { 140 if (state[AppState.Field.VERSION] == AppState.VERSION_) {
140 this.state_ = state; 141 this.state_ = state;
141 } 142 }
142 } else { 143 } else {
143 // Set some state defaults. 144 // Set some state defaults.
144 this.state_[AppState.Field.IS_GCP_PROMO_DISMISSED] = false; 145 this.state_[AppState.Field.IS_GCP_PROMO_DISMISSED] = false;
145 } 146 }
146 // Default to system destination, if no destination was selected. 147 // Default to system destination, if no destination was selected.
147 if (!this.state_[AppState.Field.SELECTED_DESTINATION_ID] || 148 if (!this.state_[AppState.Field.SELECTED_DESTINATION_ID] ||
148 !this.state_[AppState.Field.SELECTED_DESTINATION_ORIGIN]) { 149 !this.state_[AppState.Field.SELECTED_DESTINATION_ORIGIN]) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 persist_: function() { 215 persist_: function() {
215 chrome.send(AppState.NATIVE_FUNCTION_NAME_, 216 chrome.send(AppState.NATIVE_FUNCTION_NAME_,
216 [JSON.stringify(this.state_)]); 217 [JSON.stringify(this.state_)]);
217 } 218 }
218 }; 219 };
219 220
220 return { 221 return {
221 AppState: AppState 222 AppState: AppState
222 }; 223 };
223 }); 224 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698