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 #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 Loading... |
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 enum PinchPhase { |
| 239 PINCH_NONE = 0, |
| 240 PINCH_START = 1, |
| 241 PINCH_IN_UPDATE = 2, |
| 242 PINCH_OUT_UPDATE = 3, |
| 243 PINCH_END = 4 |
| 244 }; |
239 | 245 |
240 float device_scale_; // Current device scale factor. | 246 // Current zoom factor. |
| 247 double zoom_; |
| 248 double old_zoom_, initial_zoom_delta_; |
| 249 // True if we request a new bitmap rendering. |
| 250 bool needs_reraster_; |
| 251 // Scroll at the begining of zooming. |
| 252 pp::FloatPoint last_current_scroll_; |
| 253 // True if last bitmap was smaller than screen. |
| 254 bool was_smaller_; |
| 255 // Current device scale factor. |
| 256 float device_scale_; |
241 // True if the plugin is full-page. | 257 // True if the plugin is full-page. |
242 bool full_; | 258 bool full_; |
243 | 259 |
244 PaintManager paint_manager_; | 260 PaintManager paint_manager_; |
245 | 261 |
246 struct BackgroundPart { | 262 struct BackgroundPart { |
247 pp::Rect location; | 263 pp::Rect location; |
248 uint32_t color; | 264 uint32_t color; |
249 }; | 265 }; |
250 std::vector<BackgroundPart> background_parts_; | 266 std::vector<BackgroundPart> background_parts_; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 ACCESSIBILITY_STATE_PENDING, // Enabled but waiting for doc to load. | 378 ACCESSIBILITY_STATE_PENDING, // Enabled but waiting for doc to load. |
363 ACCESSIBILITY_STATE_LOADED | 379 ACCESSIBILITY_STATE_LOADED |
364 } accessibility_state_; | 380 } accessibility_state_; |
365 | 381 |
366 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance); | 382 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance); |
367 }; | 383 }; |
368 | 384 |
369 } // namespace chrome_pdf | 385 } // namespace chrome_pdf |
370 | 386 |
371 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ | 387 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ |
OLD | NEW |