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 WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 namespace WebKit { | 65 namespace WebKit { |
66 class WebInputEvent; | 66 class WebInputEvent; |
67 class WebMouseEvent; | 67 class WebMouseEvent; |
68 class WebPluginContainer; | 68 class WebPluginContainer; |
69 struct WebCompositionUnderline; | 69 struct WebCompositionUnderline; |
70 struct WebCursorInfo; | 70 struct WebCursorInfo; |
71 struct WebPrintParams; | 71 struct WebPrintParams; |
72 } | 72 } |
73 | 73 |
| 74 namespace content { |
| 75 class PepperGraphics2DHost; |
| 76 } |
| 77 |
74 namespace media { | 78 namespace media { |
75 class DecoderBuffer; | 79 class DecoderBuffer; |
76 class DecryptorClient; | 80 class DecryptorClient; |
77 } | 81 } |
78 | 82 |
79 namespace ppapi { | 83 namespace ppapi { |
80 struct InputEventData; | 84 struct InputEventData; |
81 struct PPP_Instance_Combined; | 85 struct PPP_Instance_Combined; |
82 class Resource; | 86 class Resource; |
83 struct URLRequestInfoData; | 87 struct URLRequestInfoData; |
84 } | 88 } |
85 | 89 |
86 namespace ui { | 90 namespace ui { |
87 class Range; | 91 class Range; |
88 } | 92 } |
89 | 93 |
90 namespace webkit { | 94 namespace webkit { |
91 namespace ppapi { | 95 namespace ppapi { |
92 | 96 |
93 class FullscreenContainer; | 97 class FullscreenContainer; |
94 class MessageChannel; | 98 class MessageChannel; |
95 class PluginDelegate; | 99 class PluginDelegate; |
96 class PluginModule; | 100 class PluginModule; |
97 class PluginObject; | 101 class PluginObject; |
98 class PPB_Graphics2D_Impl; | |
99 class PPB_Graphics3D_Impl; | 102 class PPB_Graphics3D_Impl; |
100 class PPB_ImageData_Impl; | 103 class PPB_ImageData_Impl; |
101 class PPB_URLLoader_Impl; | 104 class PPB_URLLoader_Impl; |
102 | 105 |
103 // Represents one time a plugin appears on one web page. | 106 // Represents one time a plugin appears on one web page. |
104 // | 107 // |
105 // Note: to get from a PP_Instance to a PluginInstance*, use the | 108 // Note: to get from a PP_Instance to a PluginInstance*, use the |
106 // ResourceTracker. | 109 // ResourceTracker. |
107 class WEBKIT_PLUGINS_EXPORT PluginInstance : | 110 class WEBKIT_PLUGINS_EXPORT PluginInstance : |
108 public base::RefCounted<PluginInstance>, | 111 public base::RefCounted<PluginInstance>, |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 void ReportGeometry(); | 519 void ReportGeometry(); |
517 | 520 |
518 // Queries the plugin for supported print formats and sets |format| to the | 521 // Queries the plugin for supported print formats and sets |format| to the |
519 // best format to use. Returns false if the plugin does not support any | 522 // best format to use. Returns false if the plugin does not support any |
520 // print format that we can handle (we can handle only PDF). | 523 // print format that we can handle (we can handle only PDF). |
521 bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format); | 524 bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format); |
522 bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); | 525 bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); |
523 | 526 |
524 // Get the bound graphics context as a concrete 2D graphics context or returns | 527 // Get the bound graphics context as a concrete 2D graphics context or returns |
525 // null if the context is not 2D. | 528 // null if the context is not 2D. |
526 PPB_Graphics2D_Impl* GetBoundGraphics2D() const; | 529 PluginDelegate::PlatformGraphics2D* GetBoundGraphics2D() const; |
527 | 530 |
528 // Get the bound 3D graphics context. | 531 // Get the bound 3D graphics context. |
529 // Returns NULL if bound graphics is not a 3D context. | 532 // Returns NULL if bound graphics is not a 3D context. |
530 PPB_Graphics3D_Impl* GetBoundGraphics3D() const; | 533 PPB_Graphics3D_Impl* GetBoundGraphics3D() const; |
531 | 534 |
532 // Sets the id of the texture that the plugin draws to. The id is in the | 535 // Sets the id of the texture that the plugin draws to. The id is in the |
533 // compositor space so it can use it to composite with rest of the page. | 536 // compositor space so it can use it to composite with rest of the page. |
534 // A value of zero indicates the plugin is not backed by a texture. | 537 // A value of zero indicates the plugin is not backed by a texture. |
535 // is_opaque is true if the plugin contents are always opaque. | 538 // is_opaque is true if the plugin contents are always opaque. |
536 void setBackingTextureId(unsigned int id, bool is_opaque); | 539 void setBackingTextureId(unsigned int id, bool is_opaque); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 // same as the default values. | 599 // same as the default values. |
597 bool sent_initial_did_change_view_; | 600 bool sent_initial_did_change_view_; |
598 | 601 |
599 // We use a weak ptr factory for scheduling DidChangeView events so that we | 602 // We use a weak ptr factory for scheduling DidChangeView events so that we |
600 // can tell whether updates are pending and consolidate them. When there's | 603 // can tell whether updates are pending and consolidate them. When there's |
601 // already a weak ptr pending (HasWeakPtrs is true), code should update the | 604 // already a weak ptr pending (HasWeakPtrs is true), code should update the |
602 // view_data_ but not send updates. This also allows us to cancel scheduled | 605 // view_data_ but not send updates. This also allows us to cancel scheduled |
603 // view change events. | 606 // view change events. |
604 base::WeakPtrFactory<PluginInstance> view_change_weak_ptr_factory_; | 607 base::WeakPtrFactory<PluginInstance> view_change_weak_ptr_factory_; |
605 | 608 |
606 // The current device context for painting in 2D or 3D. | 609 // The current device context for painting in 2D and 3D. |
607 scoped_refptr< ::ppapi::Resource> bound_graphics_; | 610 scoped_refptr< ::ppapi::Resource> bound_graphics_3d_; |
| 611 PluginDelegate::PlatformGraphics2D* graphics_2d_platform_; |
608 | 612 |
609 // We track two types of focus, one from WebKit, which is the focus among | 613 // We track two types of focus, one from WebKit, which is the focus among |
610 // all elements of the page, one one from the browser, which is whether the | 614 // all elements of the page, one one from the browser, which is whether the |
611 // tab/window has focus. We tell the plugin it has focus only when both of | 615 // tab/window has focus. We tell the plugin it has focus only when both of |
612 // these values are set to true. | 616 // these values are set to true. |
613 bool has_webkit_focus_; | 617 bool has_webkit_focus_; |
614 bool has_content_area_focus_; | 618 bool has_content_area_focus_; |
615 | 619 |
616 // The id of the current find operation, or -1 if none is in process. | 620 // The id of the current find operation, or -1 if none is in process. |
617 int find_identifier_; | 621 int find_identifier_; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 typedef std::map<uint32_t, media::Decryptor::DecryptCB> DecryptionCBMap; | 764 typedef std::map<uint32_t, media::Decryptor::DecryptCB> DecryptionCBMap; |
761 DecryptionCBMap pending_decryption_cbs_; | 765 DecryptionCBMap pending_decryption_cbs_; |
762 | 766 |
763 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 767 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
764 }; | 768 }; |
765 | 769 |
766 } // namespace ppapi | 770 } // namespace ppapi |
767 } // namespace webkit | 771 } // namespace webkit |
768 | 772 |
769 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 773 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
OLD | NEW |