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

Side by Side Diff: chrome/browser/resources/print_preview/preview_area.js

Issue 10083060: [Print Preview]: Added code to support pdf fit to page functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Fix nit Created 8 years, 7 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 | Annotate | Revision Log
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 * 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
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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/more_options.js ('k') | chrome/browser/resources/print_preview/print_preview.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698