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 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 this.state_[AppState.Field.IS_GCP_PROMO_DISMISSED] = false; | 140 this.state_[AppState.Field.IS_GCP_PROMO_DISMISSED] = false; |
141 } | 141 } |
142 // Default to system destination, if no destination was selected. | 142 // Default to system destination, if no destination was selected. |
143 if (!this.state_[AppState.Field.SELECTED_DESTINATION_ID] || | 143 if (!this.state_[AppState.Field.SELECTED_DESTINATION_ID] || |
144 !this.state_[AppState.Field.SELECTED_DESTINATION_ORIGIN]) { | 144 !this.state_[AppState.Field.SELECTED_DESTINATION_ORIGIN]) { |
145 if (systemDefaultDestinationId) { | 145 if (systemDefaultDestinationId) { |
146 this.state_[AppState.Field.SELECTED_DESTINATION_ID] = | 146 this.state_[AppState.Field.SELECTED_DESTINATION_ID] = |
147 systemDefaultDestinationId; | 147 systemDefaultDestinationId; |
148 this.state_[AppState.Field.SELECTED_DESTINATION_ORIGIN] = | 148 this.state_[AppState.Field.SELECTED_DESTINATION_ORIGIN] = |
149 print_preview.Destination.Origin.LOCAL; | 149 print_preview.Destination.Origin.LOCAL; |
| 150 this.state_[AppState.Field.SELECTED_DESTINATION_ACCOUNT] = ''; |
150 } | 151 } |
151 } | 152 } |
152 }, | 153 }, |
153 | 154 |
154 /** | 155 /** |
155 * Sets to initialized state. Now object will accept persist requests. | 156 * Sets to initialized state. Now object will accept persist requests. |
156 */ | 157 */ |
157 setInitialized: function() { | 158 setInitialized: function() { |
158 this.isInitialized_ = true; | 159 this.isInitialized_ = true; |
159 }, | 160 }, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 persist_: function() { | 210 persist_: function() { |
210 chrome.send(AppState.NATIVE_FUNCTION_NAME_, | 211 chrome.send(AppState.NATIVE_FUNCTION_NAME_, |
211 [JSON.stringify(this.state_)]); | 212 [JSON.stringify(this.state_)]); |
212 } | 213 } |
213 }; | 214 }; |
214 | 215 |
215 return { | 216 return { |
216 AppState: AppState | 217 AppState: AppState |
217 }; | 218 }; |
218 }); | 219 }); |
OLD | NEW |