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

Side by Side Diff: pdf/out_of_process_instance.h

Issue 2400743002: Improved Pinch-Zoom for PDF. (Closed)
Patch Set: Small changes. Created 4 years, 1 month 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
« no previous file with comments | « chrome/test/data/pdf/gesture_detector_test.js ('k') | pdf/out_of_process_instance.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef PDF_OUT_OF_PROCESS_INSTANCE_H_ 5 #ifndef PDF_OUT_OF_PROCESS_INSTANCE_H_
6 #define PDF_OUT_OF_PROCESS_INSTANCE_H_ 6 #define PDF_OUT_OF_PROCESS_INSTANCE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 pp::Size plugin_size_; 228 pp::Size plugin_size_;
229 // Size, in DIPs, of plugin rectangle. 229 // Size, in DIPs, of plugin rectangle.
230 pp::Size plugin_dip_size_; 230 pp::Size plugin_dip_size_;
231 // Remaining area, in pixels, to render the pdf in after accounting for 231 // Remaining area, in pixels, to render the pdf in after accounting for
232 // horizontal centering. 232 // horizontal centering.
233 pp::Rect available_area_; 233 pp::Rect available_area_;
234 // Size of entire document in pixels (i.e. if each page is 800 pixels high and 234 // Size of entire document in pixels (i.e. if each page is 800 pixels high and
235 // there are 10 pages, the height will be 8000). 235 // there are 10 pages, the height will be 8000).
236 pp::Size document_size_; 236 pp::Size document_size_;
237 237
238 double zoom_; // Current zoom factor. 238 // Enumeration of pinch states.
239 // This should match PinchPhase enum in
240 // chrome/browser/resources/pdf/viewport.js
241 enum PinchPhase {
242 PINCH_NONE = 0,
243 PINCH_START = 1,
244 PINCH_UPDATE_ZOOM_OUT = 2,
245 PINCH_UPDATE_ZOOM_IN = 3,
246 PINCH_END = 4
247 };
239 248
240 float device_scale_; // Current device scale factor. 249 // Current zoom factor.
250 double zoom_;
251 double initial_zoom_ratio_;
252 // True if we request a new bitmap rendering.
253 bool needs_reraster_;
254 // Scroll position at the start of a pinch zoom.
255 pp::FloatPoint starting_scroll_offset_;
256 // True if last bitmap was smaller than screen.
257 bool last_bitmap_smaller_;
258 double last_zoom_when_smaller_;
259 // Current device scale factor.
260 float device_scale_;
241 // True if the plugin is full-page. 261 // True if the plugin is full-page.
242 bool full_; 262 bool full_;
243 263
244 PaintManager paint_manager_; 264 PaintManager paint_manager_;
245 265
246 struct BackgroundPart { 266 struct BackgroundPart {
247 pp::Rect location; 267 pp::Rect location;
248 uint32_t color; 268 uint32_t color;
249 }; 269 };
250 std::vector<BackgroundPart> background_parts_; 270 std::vector<BackgroundPart> background_parts_;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 ACCESSIBILITY_STATE_PENDING, // Enabled but waiting for doc to load. 382 ACCESSIBILITY_STATE_PENDING, // Enabled but waiting for doc to load.
363 ACCESSIBILITY_STATE_LOADED 383 ACCESSIBILITY_STATE_LOADED
364 } accessibility_state_; 384 } accessibility_state_;
365 385
366 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance); 386 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance);
367 }; 387 };
368 388
369 } // namespace chrome_pdf 389 } // namespace chrome_pdf
370 390
371 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ 391 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_
OLDNEW
« no previous file with comments | « chrome/test/data/pdf/gesture_detector_test.js ('k') | pdf/out_of_process_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698