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 <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 class OutOfProcessInstance : public pp::Instance, | 39 class OutOfProcessInstance : public pp::Instance, |
40 public pp::Find_Private, | 40 public pp::Find_Private, |
41 public pp::Printing_Dev, | 41 public pp::Printing_Dev, |
42 public pp::Selection_Dev, | 42 public pp::Selection_Dev, |
43 public PaintManager::Client, | 43 public PaintManager::Client, |
44 public PDFEngine::Client, | 44 public PDFEngine::Client, |
45 public PreviewModeClient::Client { | 45 public PreviewModeClient::Client { |
46 public: | 46 public: |
47 explicit OutOfProcessInstance(PP_Instance instance); | 47 explicit OutOfProcessInstance(PP_Instance instance); |
48 virtual ~OutOfProcessInstance(); | 48 ~OutOfProcessInstance() override; |
49 | 49 |
50 // pp::Instance implementation. | 50 // pp::Instance implementation. |
51 virtual bool Init(uint32_t argc, | 51 bool Init(uint32_t argc, const char* argn[], const char* argv[]) override; |
52 const char* argn[], | 52 void HandleMessage(const pp::Var& message) override; |
53 const char* argv[]) override; | 53 bool HandleInputEvent(const pp::InputEvent& event) override; |
54 virtual void HandleMessage(const pp::Var& message) override; | 54 void DidChangeView(const pp::View& view) override; |
55 virtual bool HandleInputEvent(const pp::InputEvent& event) override; | |
56 virtual void DidChangeView(const pp::View& view) override; | |
57 | 55 |
58 // pp::Find_Private implementation. | 56 // pp::Find_Private implementation. |
59 virtual bool StartFind(const std::string& text, bool case_sensitive) override; | 57 bool StartFind(const std::string& text, bool case_sensitive) override; |
60 virtual void SelectFindResult(bool forward) override; | 58 void SelectFindResult(bool forward) override; |
61 virtual void StopFind() override; | 59 void StopFind() override; |
62 | 60 |
63 // pp::PaintManager::Client implementation. | 61 // pp::PaintManager::Client implementation. |
64 virtual void OnPaint(const std::vector<pp::Rect>& paint_rects, | 62 void OnPaint(const std::vector<pp::Rect>& paint_rects, |
65 std::vector<PaintManager::ReadyRect>* ready, | 63 std::vector<PaintManager::ReadyRect>* ready, |
66 std::vector<pp::Rect>* pending) override; | 64 std::vector<pp::Rect>* pending) override; |
67 | 65 |
68 // pp::Printing_Dev implementation. | 66 // pp::Printing_Dev implementation. |
69 virtual uint32_t QuerySupportedPrintOutputFormats() override; | 67 uint32_t QuerySupportedPrintOutputFormats() override; |
70 virtual int32_t PrintBegin( | 68 int32_t PrintBegin(const PP_PrintSettings_Dev& print_settings) override; |
71 const PP_PrintSettings_Dev& print_settings) override; | 69 pp::Resource PrintPages( |
72 virtual pp::Resource PrintPages( | |
73 const PP_PrintPageNumberRange_Dev* page_ranges, | 70 const PP_PrintPageNumberRange_Dev* page_ranges, |
74 uint32_t page_range_count) override; | 71 uint32_t page_range_count) override; |
75 virtual void PrintEnd() override; | 72 void PrintEnd() override; |
76 virtual bool IsPrintScalingDisabled() override; | 73 bool IsPrintScalingDisabled() override; |
77 | 74 |
78 // pp::Private implementation. | 75 // pp::Private implementation. |
79 virtual pp::Var GetLinkAtPosition(const pp::Point& point); | 76 virtual pp::Var GetLinkAtPosition(const pp::Point& point); |
80 virtual void GetPrintPresetOptionsFromDocument( | 77 virtual void GetPrintPresetOptionsFromDocument( |
81 PP_PdfPrintPresetOptions_Dev* options); | 78 PP_PdfPrintPresetOptions_Dev* options); |
82 | 79 |
83 // PPP_Selection_Dev implementation. | 80 // PPP_Selection_Dev implementation. |
84 virtual pp::Var GetSelectedText(bool html) override; | 81 pp::Var GetSelectedText(bool html) override; |
85 | 82 |
86 void FlushCallback(int32_t result); | 83 void FlushCallback(int32_t result); |
87 void DidOpen(int32_t result); | 84 void DidOpen(int32_t result); |
88 void DidOpenPreview(int32_t result); | 85 void DidOpenPreview(int32_t result); |
89 | 86 |
90 // Called when the timer is fired. | 87 // Called when the timer is fired. |
91 void OnClientTimerFired(int32_t id); | 88 void OnClientTimerFired(int32_t id); |
92 | 89 |
93 // Called to print without re-entrancy issues. | 90 // Called to print without re-entrancy issues. |
94 void OnPrint(int32_t); | 91 void OnPrint(int32_t); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 // zooming the plugin so that flickering doesn't occur while zooming. | 341 // zooming the plugin so that flickering doesn't occur while zooming. |
345 bool stop_scrolling_; | 342 bool stop_scrolling_; |
346 | 343 |
347 // The background color of the PDF viewer. | 344 // The background color of the PDF viewer. |
348 uint32 background_color_; | 345 uint32 background_color_; |
349 }; | 346 }; |
350 | 347 |
351 } // namespace chrome_pdf | 348 } // namespace chrome_pdf |
352 | 349 |
353 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ | 350 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ |
OLD | NEW |