OLD | NEW |
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 represent a recent destination in the app state. | 9 * Object used to represent a recent destination in the app state. |
10 * @constructor | 10 * @constructor |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 this.state_[AppState.Field.RECENT_DESTINATIONS] = [tmp]; | 208 this.state_[AppState.Field.RECENT_DESTINATIONS] = [tmp]; |
209 } else if (!this.state_[AppState.Field.RECENT_DESTINATIONS][0] || | 209 } else if (!this.state_[AppState.Field.RECENT_DESTINATIONS][0] || |
210 !this.state_[AppState.Field.RECENT_DESTINATIONS][0].id) { | 210 !this.state_[AppState.Field.RECENT_DESTINATIONS][0].id) { |
211 // read in incorrectly | 211 // read in incorrectly |
212 this.state_[AppState.Field.RECENT_DESTINATIONS] = []; | 212 this.state_[AppState.Field.RECENT_DESTINATIONS] = []; |
213 } else if (this.state_[AppState.Field.RECENT_DESTINATIONS].length > | 213 } else if (this.state_[AppState.Field.RECENT_DESTINATIONS].length > |
214 AppState.NUM_DESTINATIONS_) { | 214 AppState.NUM_DESTINATIONS_) { |
215 this.state_[AppState.Field.RECENT_DESTINATIONS].length = | 215 this.state_[AppState.Field.RECENT_DESTINATIONS].length = |
216 AppState.NUM_DESTINATIONS_; | 216 AppState.NUM_DESTINATIONS_; |
217 } | 217 } |
218 if (!loadTimeData.getBoolean('scalingEnabled')) | |
219 this.state_[AppState.Field.SCALING] = 100; | |
220 | |
221 }, | 218 }, |
222 | 219 |
223 /** | 220 /** |
224 * Sets to initialized state. Now object will accept persist requests. | 221 * Sets to initialized state. Now object will accept persist requests. |
225 */ | 222 */ |
226 setInitialized: function() { | 223 setInitialized: function() { |
227 this.isInitialized_ = true; | 224 this.isInitialized_ = true; |
228 }, | 225 }, |
229 | 226 |
230 /** | 227 /** |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 persist_: function() { | 299 persist_: function() { |
303 chrome.send(AppState.NATIVE_FUNCTION_NAME_, | 300 chrome.send(AppState.NATIVE_FUNCTION_NAME_, |
304 [JSON.stringify(this.state_)]); | 301 [JSON.stringify(this.state_)]); |
305 } | 302 } |
306 }; | 303 }; |
307 | 304 |
308 return { | 305 return { |
309 AppState: AppState | 306 AppState: AppState |
310 }; | 307 }; |
311 }); | 308 }); |
OLD | NEW |