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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 pp::Var GetLinkAtPosition(const pp::Point& point); | 78 pp::Var GetLinkAtPosition(const pp::Point& point); |
79 void GetPrintPresetOptionsFromDocument(PP_PdfPrintPresetOptions_Dev* options); | 79 void GetPrintPresetOptionsFromDocument(PP_PdfPrintPresetOptions_Dev* options); |
80 void EnableAccessibility(); | 80 void EnableAccessibility(); |
81 | 81 |
82 void FlushCallback(int32_t result); | 82 void FlushCallback(int32_t result); |
83 void DidOpen(int32_t result); | 83 void DidOpen(int32_t result); |
84 void DidOpenPreview(int32_t result); | 84 void DidOpenPreview(int32_t result); |
85 | 85 |
86 // Called when the timer is fired. | 86 // Called when the timer is fired. |
87 void OnClientTimerFired(int32_t id); | 87 void OnClientTimerFired(int32_t id); |
88 void OnClientTouchTimerFired(int32_t id); | |
88 | 89 |
89 // Called to print without re-entrancy issues. | 90 // Called to print without re-entrancy issues. |
90 void OnPrint(int32_t); | 91 void OnPrint(int32_t); |
91 | 92 |
92 // PDFEngine::Client implementation. | 93 // PDFEngine::Client implementation. |
93 void DocumentSizeUpdated(const pp::Size& size) override; | 94 void DocumentSizeUpdated(const pp::Size& size) override; |
94 void Invalidate(const pp::Rect& rect) override; | 95 void Invalidate(const pp::Rect& rect) override; |
95 void Scroll(const pp::Point& point) override; | 96 void Scroll(const pp::Point& point) override; |
96 void ScrollToX(int position) override; | 97 void ScrollToX(int position) override; |
97 void ScrollToY(int position) override; | 98 void ScrollToY(int position) override; |
(...skipping 16 matching lines...) Expand all Loading... | |
114 const std::string& bcc, | 115 const std::string& bcc, |
115 const std::string& subject, | 116 const std::string& subject, |
116 const std::string& body) override; | 117 const std::string& body) override; |
117 void Print() override; | 118 void Print() override; |
118 void SubmitForm(const std::string& url, | 119 void SubmitForm(const std::string& url, |
119 const void* data, | 120 const void* data, |
120 int length) override; | 121 int length) override; |
121 std::string ShowFileSelectionDialog() override; | 122 std::string ShowFileSelectionDialog() override; |
122 pp::URLLoader CreateURLLoader() override; | 123 pp::URLLoader CreateURLLoader() override; |
123 void ScheduleCallback(int id, int delay_in_ms) override; | 124 void ScheduleCallback(int id, int delay_in_ms) override; |
125 void ScheduleTouchTimerCallback(int id, int delay_in_ms) override; | |
124 void SearchString(const base::char16* string, | 126 void SearchString(const base::char16* string, |
125 const base::char16* term, | 127 const base::char16* term, |
126 bool case_sensitive, | 128 bool case_sensitive, |
127 std::vector<SearchStringResult>* results) override; | 129 std::vector<SearchStringResult>* results) override; |
128 void DocumentPaintOccurred() override; | 130 void DocumentPaintOccurred() override; |
129 void DocumentLoadComplete(int page_count) override; | 131 void DocumentLoadComplete(int page_count) override; |
130 void DocumentLoadFailed() override; | 132 void DocumentLoadFailed() override; |
131 void FontSubstituted() override; | 133 void FontSubstituted() override; |
132 pp::Instance* GetPluginInstance() override; | 134 pp::Instance* GetPluginInstance() override; |
133 void DocumentHasUnsupportedFeature(const std::string& feature) override; | 135 void DocumentHasUnsupportedFeature(const std::string& feature) override; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 // Size, in pixels, of plugin rectangle. | 230 // Size, in pixels, of plugin rectangle. |
229 pp::Size plugin_size_; | 231 pp::Size plugin_size_; |
230 // Size, in DIPs, of plugin rectangle. | 232 // Size, in DIPs, of plugin rectangle. |
231 pp::Size plugin_dip_size_; | 233 pp::Size plugin_dip_size_; |
232 // Remaining area, in pixels, to render the pdf in after accounting for | 234 // Remaining area, in pixels, to render the pdf in after accounting for |
233 // horizontal centering. | 235 // horizontal centering. |
234 pp::Rect available_area_; | 236 pp::Rect available_area_; |
235 // Size of entire document in pixels (i.e. if each page is 800 pixels high and | 237 // Size of entire document in pixels (i.e. if each page is 800 pixels high and |
236 // there are 10 pages, the height will be 8000). | 238 // there are 10 pages, the height will be 8000). |
237 pp::Size document_size_; | 239 pp::Size document_size_; |
240 // The scroll offset | |
241 pp::Point scroll_offset_; | |
Lei Zhang
2017/05/03 01:52:53
BTW, there's another scroll offset below that's a
dsinclair
2017/05/03 14:18:41
The one below is used specifically for pinch zoomi
| |
238 | 242 |
239 // Enumeration of pinch states. | 243 // Enumeration of pinch states. |
240 // This should match PinchPhase enum in | 244 // This should match PinchPhase enum in |
241 // chrome/browser/resources/pdf/viewport.js | 245 // chrome/browser/resources/pdf/viewport.js |
242 enum PinchPhase { | 246 enum PinchPhase { |
243 PINCH_NONE = 0, | 247 PINCH_NONE = 0, |
244 PINCH_START = 1, | 248 PINCH_START = 1, |
245 PINCH_UPDATE_ZOOM_OUT = 2, | 249 PINCH_UPDATE_ZOOM_OUT = 2, |
246 PINCH_UPDATE_ZOOM_IN = 3, | 250 PINCH_UPDATE_ZOOM_IN = 3, |
247 PINCH_END = 4 | 251 PINCH_END = 4 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
389 | 393 |
390 // True if the plugin is loaded in print preview, otherwise false. | 394 // True if the plugin is loaded in print preview, otherwise false. |
391 bool is_print_preview_; | 395 bool is_print_preview_; |
392 | 396 |
393 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance); | 397 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance); |
394 }; | 398 }; |
395 | 399 |
396 } // namespace chrome_pdf | 400 } // namespace chrome_pdf |
397 | 401 |
398 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ | 402 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ |
OLD | NEW |