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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 void StopFind() override; | 61 void StopFind() override; |
62 | 62 |
63 // pp::PaintManager::Client implementation. | 63 // pp::PaintManager::Client implementation. |
64 void OnPaint(const std::vector<pp::Rect>& paint_rects, | 64 void OnPaint(const std::vector<pp::Rect>& paint_rects, |
65 std::vector<PaintManager::ReadyRect>* ready, | 65 std::vector<PaintManager::ReadyRect>* ready, |
66 std::vector<pp::Rect>* pending) override; | 66 std::vector<pp::Rect>* pending) override; |
67 | 67 |
68 // pp::Printing_Dev implementation. | 68 // pp::Printing_Dev implementation. |
69 uint32_t QuerySupportedPrintOutputFormats() override; | 69 uint32_t QuerySupportedPrintOutputFormats() override; |
70 int32_t PrintBegin(const PP_PrintSettings_Dev& print_settings) override; | 70 int32_t PrintBegin(const PP_PrintSettings_Dev& print_settings) override; |
71 pp::Resource PrintPages( | 71 pp::Resource PrintPages(const PP_PrintPageNumberRange_Dev* page_ranges, |
72 const PP_PrintPageNumberRange_Dev* page_ranges, | 72 uint32_t page_range_count) override; |
73 uint32_t page_range_count) override; | |
74 void PrintEnd() override; | 73 void PrintEnd() override; |
75 bool IsPrintScalingDisabled() override; | 74 bool IsPrintScalingDisabled() override; |
76 | 75 |
77 // pp::Private implementation. | 76 // pp::Private implementation. |
78 pp::Var GetLinkAtPosition(const pp::Point& point); | 77 pp::Var GetLinkAtPosition(const pp::Point& point); |
79 void GetPrintPresetOptionsFromDocument(PP_PdfPrintPresetOptions_Dev* options); | 78 void GetPrintPresetOptionsFromDocument(PP_PdfPrintPresetOptions_Dev* options); |
80 void EnableAccessibility(); | 79 void EnableAccessibility(); |
81 | 80 |
82 void FlushCallback(int32_t result); | 81 void FlushCallback(int32_t result); |
83 void DidOpen(int32_t result); | 82 void DidOpen(int32_t result); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // Computes document width/height in device pixels, based on current zoom and | 158 // Computes document width/height in device pixels, based on current zoom and |
160 // device scale | 159 // device scale |
161 int GetDocumentPixelWidth() const; | 160 int GetDocumentPixelWidth() const; |
162 int GetDocumentPixelHeight() const; | 161 int GetDocumentPixelHeight() const; |
163 | 162 |
164 // Draws a rectangle with the specified dimensions and color in our buffer. | 163 // Draws a rectangle with the specified dimensions and color in our buffer. |
165 void FillRect(const pp::Rect& rect, uint32_t color); | 164 void FillRect(const pp::Rect& rect, uint32_t color); |
166 | 165 |
167 void LoadUrl(const std::string& url); | 166 void LoadUrl(const std::string& url); |
168 void LoadPreviewUrl(const std::string& url); | 167 void LoadPreviewUrl(const std::string& url); |
169 void LoadUrlInternal(const std::string& url, pp::URLLoader* loader, | 168 void LoadUrlInternal(const std::string& url, |
170 void (OutOfProcessInstance::* method)(int32_t)); | 169 pp::URLLoader* loader, |
| 170 void (OutOfProcessInstance::*method)(int32_t)); |
171 | 171 |
172 // Creates a URL loader and allows it to access all urls, i.e. not just the | 172 // Creates a URL loader and allows it to access all urls, i.e. not just the |
173 // frame's origin. | 173 // frame's origin. |
174 pp::URLLoader CreateURLLoaderInternal(); | 174 pp::URLLoader CreateURLLoaderInternal(); |
175 | 175 |
176 void FormDidOpen(int32_t result); | 176 void FormDidOpen(int32_t result); |
177 | 177 |
178 void UserMetricsRecordAction(const std::string& action); | 178 void UserMetricsRecordAction(const std::string& action); |
179 | 179 |
180 // Start loading accessibility information. | 180 // Start loading accessibility information. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 263 |
264 PaintManager paint_manager_; | 264 PaintManager paint_manager_; |
265 | 265 |
266 struct BackgroundPart { | 266 struct BackgroundPart { |
267 pp::Rect location; | 267 pp::Rect location; |
268 uint32_t color; | 268 uint32_t color; |
269 }; | 269 }; |
270 std::vector<BackgroundPart> background_parts_; | 270 std::vector<BackgroundPart> background_parts_; |
271 | 271 |
272 struct PrintSettings { | 272 struct PrintSettings { |
273 PrintSettings() { | 273 PrintSettings() { Clear(); } |
274 Clear(); | |
275 } | |
276 void Clear() { | 274 void Clear() { |
277 is_printing = false; | 275 is_printing = false; |
278 print_pages_called_ = false; | 276 print_pages_called_ = false; |
279 memset(&pepper_print_settings, 0, sizeof(pepper_print_settings)); | 277 memset(&pepper_print_settings, 0, sizeof(pepper_print_settings)); |
280 } | 278 } |
281 // This is set to true when PrintBegin is called and false when PrintEnd is | 279 // This is set to true when PrintBegin is called and false when PrintEnd is |
282 // called. | 280 // called. |
283 bool is_printing; | 281 bool is_printing; |
284 // To know whether this was an actual print operation, so we don't double | 282 // To know whether this was an actual print operation, so we don't double |
285 // count UMA logging. | 283 // count UMA logging. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 387 |
390 // True if the plugin is loaded in print preview, otherwise false. | 388 // True if the plugin is loaded in print preview, otherwise false. |
391 bool is_print_preview_; | 389 bool is_print_preview_; |
392 | 390 |
393 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance); | 391 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance); |
394 }; | 392 }; |
395 | 393 |
396 } // namespace chrome_pdf | 394 } // namespace chrome_pdf |
397 | 395 |
398 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ | 396 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ |
OLD | NEW |