Chromium Code Reviews| 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 // 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 at the beginning of zooming. | |
|
Lei Zhang
2016/10/31 22:49:04
nit: s/Scroll/Scroll position/ ?
Kevin McNee - google account
2016/11/07 23:08:27
Done.
| |
| 255 pp::FloatPoint last_current_scroll_; | |
|
Lei Zhang
2016/10/31 22:49:04
Does "last current" sounds weird to you?
Kevin McNee - google account
2016/11/07 23:08:27
Done.
| |
| 256 // True if last bitmap was smaller than screen. | |
| 257 bool was_smaller_; | |
|
Lei Zhang
2016/10/31 22:49:04
Maybe "last_bitmap_smaller_" since it's not obviou
Kevin McNee - google account
2016/11/07 23:08:27
Done.
| |
| 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 Loading... | |
| 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_ |
| OLD | NEW |