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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 | 65 |
66 namespace WebKit { | 66 namespace WebKit { |
67 class WebInputEvent; | 67 class WebInputEvent; |
68 class WebMouseEvent; | 68 class WebMouseEvent; |
69 class WebPluginContainer; | 69 class WebPluginContainer; |
70 struct WebCompositionUnderline; | 70 struct WebCompositionUnderline; |
71 struct WebCursorInfo; | 71 struct WebCursorInfo; |
72 struct WebPrintParams; | 72 struct WebPrintParams; |
73 } | 73 } |
74 | 74 |
75 namespace content { | |
76 class PepperGraphics2DHost; | |
77 } | |
78 | |
75 namespace media { | 79 namespace media { |
76 class DecoderBuffer; | 80 class DecoderBuffer; |
77 class DecryptorClient; | 81 class DecryptorClient; |
78 class VideoDecoderConfig; | 82 class VideoDecoderConfig; |
79 } | 83 } |
80 | 84 |
81 namespace ppapi { | 85 namespace ppapi { |
82 struct InputEventData; | 86 struct InputEventData; |
83 struct PPP_Instance_Combined; | 87 struct PPP_Instance_Combined; |
84 class Resource; | 88 class Resource; |
85 struct URLRequestInfoData; | 89 struct URLRequestInfoData; |
86 } | 90 } |
87 | 91 |
88 namespace ui { | 92 namespace ui { |
89 class Range; | 93 class Range; |
90 } | 94 } |
91 | 95 |
92 namespace webkit { | 96 namespace webkit { |
93 namespace ppapi { | 97 namespace ppapi { |
94 | 98 |
95 class FullscreenContainer; | 99 class FullscreenContainer; |
96 class MessageChannel; | 100 class MessageChannel; |
97 class PluginDelegate; | 101 class PluginDelegate; |
98 class PluginModule; | 102 class PluginModule; |
99 class PluginObject; | 103 class PluginObject; |
100 class PPB_Graphics2D_Impl; | |
101 class PPB_Graphics3D_Impl; | 104 class PPB_Graphics3D_Impl; |
102 class PPB_ImageData_Impl; | 105 class PPB_ImageData_Impl; |
103 class PPB_URLLoader_Impl; | 106 class PPB_URLLoader_Impl; |
104 | 107 |
105 // Represents one time a plugin appears on one web page. | 108 // Represents one time a plugin appears on one web page. |
106 // | 109 // |
107 // Note: to get from a PP_Instance to a PluginInstance*, use the | 110 // Note: to get from a PP_Instance to a PluginInstance*, use the |
108 // ResourceTracker. | 111 // ResourceTracker. |
109 class WEBKIT_PLUGINS_EXPORT PluginInstance : | 112 class WEBKIT_PLUGINS_EXPORT PluginInstance : |
110 public base::RefCounted<PluginInstance>, | 113 public base::RefCounted<PluginInstance>, |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
542 void ReportGeometry(); | 545 void ReportGeometry(); |
543 | 546 |
544 // Queries the plugin for supported print formats and sets |format| to the | 547 // Queries the plugin for supported print formats and sets |format| to the |
545 // best format to use. Returns false if the plugin does not support any | 548 // best format to use. Returns false if the plugin does not support any |
546 // print format that we can handle (we can handle only PDF). | 549 // print format that we can handle (we can handle only PDF). |
547 bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format); | 550 bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format); |
548 bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); | 551 bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); |
549 | 552 |
550 // Get the bound graphics context as a concrete 2D graphics context or returns | 553 // Get the bound graphics context as a concrete 2D graphics context or returns |
551 // null if the context is not 2D. | 554 // null if the context is not 2D. |
552 PPB_Graphics2D_Impl* GetBoundGraphics2D() const; | 555 PluginDelegate::PlatformGraphics2D* GetBoundGraphics2D() const; |
553 | 556 |
554 // Get the bound 3D graphics context. | 557 // Get the bound 3D graphics context. |
555 // Returns NULL if bound graphics is not a 3D context. | 558 // Returns NULL if bound graphics is not a 3D context. |
556 PPB_Graphics3D_Impl* GetBoundGraphics3D() const; | 559 PPB_Graphics3D_Impl* GetBoundGraphics3D() const; |
557 | 560 |
558 // Sets the id of the texture that the plugin draws to. The id is in the | 561 // Sets the id of the texture that the plugin draws to. The id is in the |
559 // compositor space so it can use it to composite with rest of the page. | 562 // compositor space so it can use it to composite with rest of the page. |
560 // A value of zero indicates the plugin is not backed by a texture. | 563 // A value of zero indicates the plugin is not backed by a texture. |
561 // is_opaque is true if the plugin contents are always opaque. | 564 // is_opaque is true if the plugin contents are always opaque. |
562 void setBackingTextureId(unsigned int id, bool is_opaque); | 565 void setBackingTextureId(unsigned int id, bool is_opaque); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
622 // same as the default values. | 625 // same as the default values. |
623 bool sent_initial_did_change_view_; | 626 bool sent_initial_did_change_view_; |
624 | 627 |
625 // We use a weak ptr factory for scheduling DidChangeView events so that we | 628 // We use a weak ptr factory for scheduling DidChangeView events so that we |
626 // can tell whether updates are pending and consolidate them. When there's | 629 // can tell whether updates are pending and consolidate them. When there's |
627 // already a weak ptr pending (HasWeakPtrs is true), code should update the | 630 // already a weak ptr pending (HasWeakPtrs is true), code should update the |
628 // view_data_ but not send updates. This also allows us to cancel scheduled | 631 // view_data_ but not send updates. This also allows us to cancel scheduled |
629 // view change events. | 632 // view change events. |
630 base::WeakPtrFactory<PluginInstance> view_change_weak_ptr_factory_; | 633 base::WeakPtrFactory<PluginInstance> view_change_weak_ptr_factory_; |
631 | 634 |
632 // The current device context for painting in 2D or 3D. | 635 // The current device context for painting in 2D and 3D. |
633 scoped_refptr< ::ppapi::Resource> bound_graphics_; | 636 scoped_refptr< ::ppapi::Resource> bound_graphics_3d_; |
637 PluginDelegate::PlatformGraphics2D* graphics_2d_platform_; | |
brettw
2012/10/19 21:44:13
Can you call this "bound_graphics_2d_platform_"?
victorhsieh
2012/10/22 02:18:53
Done.
| |
634 | 638 |
635 // We track two types of focus, one from WebKit, which is the focus among | 639 // We track two types of focus, one from WebKit, which is the focus among |
636 // all elements of the page, one one from the browser, which is whether the | 640 // all elements of the page, one one from the browser, which is whether the |
637 // tab/window has focus. We tell the plugin it has focus only when both of | 641 // tab/window has focus. We tell the plugin it has focus only when both of |
638 // these values are set to true. | 642 // these values are set to true. |
639 bool has_webkit_focus_; | 643 bool has_webkit_focus_; |
640 bool has_content_area_focus_; | 644 bool has_content_area_focus_; |
641 | 645 |
642 // The id of the current find operation, or -1 if none is in process. | 646 // The id of the current find operation, or -1 if none is in process. |
643 int find_identifier_; | 647 int find_identifier_; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
786 typedef std::map<uint32_t, media::Decryptor::DecryptCB> DecryptionCBMap; | 790 typedef std::map<uint32_t, media::Decryptor::DecryptCB> DecryptionCBMap; |
787 DecryptionCBMap pending_decryption_cbs_; | 791 DecryptionCBMap pending_decryption_cbs_; |
788 | 792 |
789 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 793 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
790 }; | 794 }; |
791 | 795 |
792 } // namespace ppapi | 796 } // namespace ppapi |
793 } // namespace webkit | 797 } // namespace webkit |
794 | 798 |
795 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 799 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
OLD | NEW |