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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 pp::Var GetLinkAtPosition(const pp::Point& point); | 77 pp::Var GetLinkAtPosition(const pp::Point& point); |
78 void GetPrintPresetOptionsFromDocument(PP_PdfPrintPresetOptions_Dev* options); | 78 void GetPrintPresetOptionsFromDocument(PP_PdfPrintPresetOptions_Dev* options); |
79 void EnableAccessibility(); | 79 void EnableAccessibility(); |
80 | 80 |
81 void FlushCallback(int32_t result); | 81 void FlushCallback(int32_t result); |
82 void DidOpen(int32_t result); | 82 void DidOpen(int32_t result); |
83 void DidOpenPreview(int32_t result); | 83 void DidOpenPreview(int32_t result); |
84 | 84 |
85 // Called when the timer is fired. | 85 // Called when the timer is fired. |
86 void OnClientTimerFired(int32_t id); | 86 void OnClientTimerFired(int32_t id); |
87 void OnClientTouchTimerFired(int32_t id); | |
88 | 87 |
89 // Called to print without re-entrancy issues. | 88 // Called to print without re-entrancy issues. |
90 void OnPrint(int32_t); | 89 void OnPrint(int32_t); |
91 | 90 |
92 // PDFEngine::Client implementation. | 91 // PDFEngine::Client implementation. |
93 void DocumentSizeUpdated(const pp::Size& size) override; | 92 void DocumentSizeUpdated(const pp::Size& size) override; |
94 void Invalidate(const pp::Rect& rect) override; | 93 void Invalidate(const pp::Rect& rect) override; |
95 void Scroll(const pp::Point& point) override; | 94 void Scroll(const pp::Point& point) override; |
96 void ScrollToX(int position) override; | 95 void ScrollToX(int position) override; |
97 void ScrollToY(int position) override; | 96 void ScrollToY(int position) override; |
(...skipping 16 matching lines...) Expand all Loading... |
114 const std::string& bcc, | 113 const std::string& bcc, |
115 const std::string& subject, | 114 const std::string& subject, |
116 const std::string& body) override; | 115 const std::string& body) override; |
117 void Print() override; | 116 void Print() override; |
118 void SubmitForm(const std::string& url, | 117 void SubmitForm(const std::string& url, |
119 const void* data, | 118 const void* data, |
120 int length) override; | 119 int length) override; |
121 std::string ShowFileSelectionDialog() override; | 120 std::string ShowFileSelectionDialog() override; |
122 pp::URLLoader CreateURLLoader() override; | 121 pp::URLLoader CreateURLLoader() override; |
123 void ScheduleCallback(int id, int delay_in_ms) override; | 122 void ScheduleCallback(int id, int delay_in_ms) override; |
124 void ScheduleTouchTimerCallback(int id, int delay_in_ms) override; | |
125 void SearchString(const base::char16* string, | 123 void SearchString(const base::char16* string, |
126 const base::char16* term, | 124 const base::char16* term, |
127 bool case_sensitive, | 125 bool case_sensitive, |
128 std::vector<SearchStringResult>* results) override; | 126 std::vector<SearchStringResult>* results) override; |
129 void DocumentPaintOccurred() override; | 127 void DocumentPaintOccurred() override; |
130 void DocumentLoadComplete(int page_count) override; | 128 void DocumentLoadComplete(int page_count) override; |
131 void DocumentLoadFailed() override; | 129 void DocumentLoadFailed() override; |
132 void FontSubstituted() override; | 130 void FontSubstituted() override; |
133 pp::Instance* GetPluginInstance() override; | 131 pp::Instance* GetPluginInstance() override; |
134 void DocumentHasUnsupportedFeature(const std::string& feature) override; | 132 void DocumentHasUnsupportedFeature(const std::string& feature) override; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // Size, in pixels, of plugin rectangle. | 221 // Size, in pixels, of plugin rectangle. |
224 pp::Size plugin_size_; | 222 pp::Size plugin_size_; |
225 // Size, in DIPs, of plugin rectangle. | 223 // Size, in DIPs, of plugin rectangle. |
226 pp::Size plugin_dip_size_; | 224 pp::Size plugin_dip_size_; |
227 // Remaining area, in pixels, to render the pdf in after accounting for | 225 // Remaining area, in pixels, to render the pdf in after accounting for |
228 // horizontal centering. | 226 // horizontal centering. |
229 pp::Rect available_area_; | 227 pp::Rect available_area_; |
230 // Size of entire document in pixels (i.e. if each page is 800 pixels high and | 228 // Size of entire document in pixels (i.e. if each page is 800 pixels high and |
231 // there are 10 pages, the height will be 8000). | 229 // there are 10 pages, the height will be 8000). |
232 pp::Size document_size_; | 230 pp::Size document_size_; |
233 // The scroll offset in CSS pixels. | |
234 pp::Point scroll_offset_; | |
235 | 231 |
236 // Enumeration of pinch states. | 232 // Enumeration of pinch states. |
237 // This should match PinchPhase enum in | 233 // This should match PinchPhase enum in |
238 // chrome/browser/resources/pdf/viewport.js | 234 // chrome/browser/resources/pdf/viewport.js |
239 enum PinchPhase { | 235 enum PinchPhase { |
240 PINCH_NONE = 0, | 236 PINCH_NONE = 0, |
241 PINCH_START = 1, | 237 PINCH_START = 1, |
242 PINCH_UPDATE_ZOOM_OUT = 2, | 238 PINCH_UPDATE_ZOOM_OUT = 2, |
243 PINCH_UPDATE_ZOOM_IN = 3, | 239 PINCH_UPDATE_ZOOM_IN = 3, |
244 PINCH_END = 4 | 240 PINCH_END = 4 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 378 |
383 // True if the plugin is loaded in print preview, otherwise false. | 379 // True if the plugin is loaded in print preview, otherwise false. |
384 bool is_print_preview_; | 380 bool is_print_preview_; |
385 | 381 |
386 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance); | 382 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance); |
387 }; | 383 }; |
388 | 384 |
389 } // namespace chrome_pdf | 385 } // namespace chrome_pdf |
390 | 386 |
391 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ | 387 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ |
OLD | NEW |