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

Side by Side Diff: chrome/browser/resources/pdf/viewport.js

Issue 282113004: Implement sendKeyEvent print preview function for OOP PDF. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/resources/pdf/pdf_scripting_api.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 /** 5 /**
6 * Returns the area of the intersection of two rectangles. 6 * Returns the area of the intersection of two rectangles.
7 * @param {Object} rect1 the first rect 7 * @param {Object} rect1 the first rect
8 * @param {Object} rect2 the second rect 8 * @param {Object} rect2 the second rect
9 * @return {number} the area of the intersection of the rects 9 * @return {number} the area of the intersection of the rects
10 */ 10 */
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 * Enumeration of page fitting types. 47 * Enumeration of page fitting types.
48 * @enum {string} 48 * @enum {string}
49 */ 49 */
50 Viewport.FittingType = { 50 Viewport.FittingType = {
51 NONE: 'none', 51 NONE: 'none',
52 FIT_TO_PAGE: 'fit-to-page', 52 FIT_TO_PAGE: 'fit-to-page',
53 FIT_TO_WIDTH: 'fit-to-width' 53 FIT_TO_WIDTH: 'fit-to-width'
54 }; 54 };
55 55
56 /** 56 /**
57 * The increment to scroll a page by in pixels when up/down/left/right arrow
Lei Zhang 2014/05/28 22:23:54 Does this matter if we are on a hidpi screen?
raymes 2014/05/30 07:10:37 No it shouldn't. All the measurements are in devic
58 * keys are pressed. Usually we just let the browser handle scrolling on the
59 * window when these keys are pressed but in certain cases we need to simulate
60 * these events.
61 */
62 Viewport.SCROLL_INCREMENT = 40;
63
64 /**
57 * Predefined zoom factors to be used when zooming in/out. These are in 65 * Predefined zoom factors to be used when zooming in/out. These are in
58 * ascending order. 66 * ascending order.
59 */ 67 */
60 Viewport.ZOOM_FACTORS = [0.25, 0.333, 0.5, 0.666, 0.75, 0.9, 1, 68 Viewport.ZOOM_FACTORS = [0.25, 0.333, 0.5, 0.666, 0.75, 0.9, 1,
61 1.1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4, 5]; 69 1.1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4, 5];
62 70
63 /** 71 /**
64 * The width of the page shadow around pages in pixels. 72 * The width of the page shadow around pages in pixels.
65 */ 73 */
66 Viewport.PAGE_SHADOW = {top: 3, bottom: 7, left: 5, right: 5}; 74 Viewport.PAGE_SHADOW = {top: 3, bottom: 7, left: 5, right: 5};
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 spaceOnLeft = Math.max(spaceOnLeft, 0); 461 spaceOnLeft = Math.max(spaceOnLeft, 0);
454 462
455 return { 463 return {
456 x: x * this.zoom_ + spaceOnLeft - this.window_.pageXOffset, 464 x: x * this.zoom_ + spaceOnLeft - this.window_.pageXOffset,
457 y: insetDimensions.y * this.zoom_ - this.window_.pageYOffset, 465 y: insetDimensions.y * this.zoom_ - this.window_.pageYOffset,
458 width: insetDimensions.width * this.zoom_, 466 width: insetDimensions.width * this.zoom_,
459 height: insetDimensions.height * this.zoom_ 467 height: insetDimensions.height * this.zoom_
460 }; 468 };
461 } 469 }
462 }; 470 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/pdf/pdf_scripting_api.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698