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 * Creates a PreviewArea object. It represents the area where the preview | 9 * Creates a PreviewArea object. It represents the area where the preview |
10 * document is displayed. | 10 * document is displayed. |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 parseFloat(pluginLocation[0]), | 164 parseFloat(pluginLocation[0]), |
165 parseFloat(pluginLocation[1]), | 165 parseFloat(pluginLocation[1]), |
166 parseFloat(pluginLocation[2]), | 166 parseFloat(pluginLocation[2]), |
167 parseFloat(pluginLocation[3])); | 167 parseFloat(pluginLocation[3])); |
168 }, | 168 }, |
169 | 169 |
170 /** | 170 /** |
171 * Resets the state variables of |this|. | 171 * Resets the state variables of |this|. |
172 */ | 172 */ |
173 resetState: function() { | 173 resetState: function() { |
174 if (this.pdfPlugin_) { | 174 if (this.pdfPlugin_ && previewModifiable) { |
175 this.zoomLevel_ = this.pdfPlugin_.getZoomLevel(); | 175 this.zoomLevel_ = this.pdfPlugin_.getZoomLevel(); |
176 this.pageOffset_ = { | 176 this.pageOffset_ = { |
177 x: this.pdfPlugin_.pageXOffset(), | 177 x: this.pdfPlugin_.pageXOffset(), |
178 y: this.pdfPlugin_.pageYOffset() | 178 y: this.pdfPlugin_.pageYOffset() |
179 }; | 179 }; |
180 } | 180 } |
181 this.pdfLoaded_ = false; | 181 this.pdfLoaded_ = false; |
182 }, | 182 }, |
183 | 183 |
184 /** | 184 /** |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 if (cr.isMac) | 290 if (cr.isMac) |
291 $('open-preview-app-throbber').hidden = true; | 291 $('open-preview-app-throbber').hidden = true; |
292 this.displayErrorMessageAndNotify(errorMessage); | 292 this.displayErrorMessageAndNotify(errorMessage); |
293 } | 293 } |
294 }; | 294 }; |
295 | 295 |
296 return { | 296 return { |
297 PreviewArea: PreviewArea | 297 PreviewArea: PreviewArea |
298 }; | 298 }; |
299 }); | 299 }); |
OLD | NEW |