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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 namespace webkit { | 82 namespace webkit { |
83 namespace ppapi { | 83 namespace ppapi { |
84 | 84 |
85 class ContentDecryptorDelegate; | 85 class ContentDecryptorDelegate; |
86 class FullscreenContainer; | 86 class FullscreenContainer; |
87 class MessageChannel; | 87 class MessageChannel; |
88 class PluginDelegate; | 88 class PluginDelegate; |
89 class PluginModule; | 89 class PluginModule; |
90 class PluginObject; | 90 class PluginObject; |
91 class PPB_Graphics2D_Impl; | |
92 class PPB_Graphics3D_Impl; | 91 class PPB_Graphics3D_Impl; |
93 class PPB_ImageData_Impl; | 92 class PPB_ImageData_Impl; |
94 class PPB_URLLoader_Impl; | 93 class PPB_URLLoader_Impl; |
95 | 94 |
96 // Represents one time a plugin appears on one web page. | 95 // Represents one time a plugin appears on one web page. |
97 // | 96 // |
98 // Note: to get from a PP_Instance to a PluginInstance*, use the | 97 // Note: to get from a PP_Instance to a PluginInstance*, use the |
99 // ResourceTracker. | 98 // ResourceTracker. |
100 class WEBKIT_PLUGINS_EXPORT PluginInstance : | 99 class WEBKIT_PLUGINS_EXPORT PluginInstance : |
101 public base::RefCounted<PluginInstance>, | 100 public base::RefCounted<PluginInstance>, |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 void ReportGeometry(); | 509 void ReportGeometry(); |
511 | 510 |
512 // Queries the plugin for supported print formats and sets |format| to the | 511 // Queries the plugin for supported print formats and sets |format| to the |
513 // best format to use. Returns false if the plugin does not support any | 512 // best format to use. Returns false if the plugin does not support any |
514 // print format that we can handle (we can handle only PDF). | 513 // print format that we can handle (we can handle only PDF). |
515 bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format); | 514 bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format); |
516 bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); | 515 bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); |
517 | 516 |
518 // Get the bound graphics context as a concrete 2D graphics context or returns | 517 // Get the bound graphics context as a concrete 2D graphics context or returns |
519 // null if the context is not 2D. | 518 // null if the context is not 2D. |
520 PPB_Graphics2D_Impl* GetBoundGraphics2D() const; | 519 PluginDelegate::PlatformGraphics2D* GetBoundGraphics2D() const; |
521 | 520 |
522 // Get the bound 3D graphics context. | 521 // Get the bound 3D graphics context. |
523 // Returns NULL if bound graphics is not a 3D context. | 522 // Returns NULL if bound graphics is not a 3D context. |
524 PPB_Graphics3D_Impl* GetBoundGraphics3D() const; | 523 PPB_Graphics3D_Impl* GetBoundGraphics3D() const; |
525 | 524 |
526 // Sets the id of the texture that the plugin draws to. The id is in the | 525 // Sets the id of the texture that the plugin draws to. The id is in the |
527 // compositor space so it can use it to composite with rest of the page. | 526 // compositor space so it can use it to composite with rest of the page. |
528 // A value of zero indicates the plugin is not backed by a texture. | 527 // A value of zero indicates the plugin is not backed by a texture. |
529 // is_opaque is true if the plugin contents are always opaque. | 528 // is_opaque is true if the plugin contents are always opaque. |
530 void setBackingTextureId(unsigned int id, bool is_opaque); | 529 void setBackingTextureId(unsigned int id, bool is_opaque); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 // same as the default values. | 592 // same as the default values. |
594 bool sent_initial_did_change_view_; | 593 bool sent_initial_did_change_view_; |
595 | 594 |
596 // We use a weak ptr factory for scheduling DidChangeView events so that we | 595 // We use a weak ptr factory for scheduling DidChangeView events so that we |
597 // can tell whether updates are pending and consolidate them. When there's | 596 // can tell whether updates are pending and consolidate them. When there's |
598 // already a weak ptr pending (HasWeakPtrs is true), code should update the | 597 // already a weak ptr pending (HasWeakPtrs is true), code should update the |
599 // view_data_ but not send updates. This also allows us to cancel scheduled | 598 // view_data_ but not send updates. This also allows us to cancel scheduled |
600 // view change events. | 599 // view change events. |
601 base::WeakPtrFactory<PluginInstance> view_change_weak_ptr_factory_; | 600 base::WeakPtrFactory<PluginInstance> view_change_weak_ptr_factory_; |
602 | 601 |
603 // The current device context for painting in 2D or 3D. | 602 // The current device context for painting in 2D and 3D. |
604 scoped_refptr< ::ppapi::Resource> bound_graphics_; | 603 scoped_refptr< ::ppapi::Resource> bound_graphics_3d_; |
| 604 PluginDelegate::PlatformGraphics2D* bound_graphics_2d_platform_; |
605 | 605 |
606 // We track two types of focus, one from WebKit, which is the focus among | 606 // We track two types of focus, one from WebKit, which is the focus among |
607 // all elements of the page, one one from the browser, which is whether the | 607 // all elements of the page, one one from the browser, which is whether the |
608 // tab/window has focus. We tell the plugin it has focus only when both of | 608 // tab/window has focus. We tell the plugin it has focus only when both of |
609 // these values are set to true. | 609 // these values are set to true. |
610 bool has_webkit_focus_; | 610 bool has_webkit_focus_; |
611 bool has_content_area_focus_; | 611 bool has_content_area_focus_; |
612 | 612 |
613 // The id of the current find operation, or -1 if none is in process. | 613 // The id of the current find operation, or -1 if none is in process. |
614 int find_identifier_; | 614 int find_identifier_; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 // calls and handles PPB_ContentDecryptor_Private calls. | 755 // calls and handles PPB_ContentDecryptor_Private calls. |
756 scoped_ptr<ContentDecryptorDelegate> content_decryptor_delegate_; | 756 scoped_ptr<ContentDecryptorDelegate> content_decryptor_delegate_; |
757 | 757 |
758 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 758 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
759 }; | 759 }; |
760 | 760 |
761 } // namespace ppapi | 761 } // namespace ppapi |
762 } // namespace webkit | 762 } // namespace webkit |
763 | 763 |
764 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 764 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
OLD | NEW |