| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 struct WebCompositionUnderline; | 73 struct WebCompositionUnderline; |
| 74 struct WebCursorInfo; | 74 struct WebCursorInfo; |
| 75 struct WebURLError; | 75 struct WebURLError; |
| 76 struct WebPrintParams; | 76 struct WebPrintParams; |
| 77 } | 77 } |
| 78 | 78 |
| 79 namespace cc { | 79 namespace cc { |
| 80 class TextureLayer; | 80 class TextureLayer; |
| 81 } | 81 } |
| 82 | 82 |
| 83 namespace content { |
| 84 class RenderView; |
| 85 } |
| 86 |
| 83 namespace ppapi { | 87 namespace ppapi { |
| 84 struct InputEventData; | 88 struct InputEventData; |
| 85 struct PPP_Instance_Combined; | 89 struct PPP_Instance_Combined; |
| 86 class Resource; | 90 class Resource; |
| 87 struct URLRequestInfoData; | 91 struct URLRequestInfoData; |
| 88 } | 92 } |
| 89 | 93 |
| 90 namespace ui { | 94 namespace ui { |
| 91 class Range; | 95 class Range; |
| 92 } | 96 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 115 class WEBKIT_PLUGINS_EXPORT PluginInstance : | 119 class WEBKIT_PLUGINS_EXPORT PluginInstance : |
| 116 public base::RefCounted<PluginInstance>, | 120 public base::RefCounted<PluginInstance>, |
| 117 public base::SupportsWeakPtr<PluginInstance>, | 121 public base::SupportsWeakPtr<PluginInstance>, |
| 118 public ::ppapi::PPB_Instance_Shared { | 122 public ::ppapi::PPB_Instance_Shared { |
| 119 public: | 123 public: |
| 120 // Create and return a PluginInstance object which supports the most recent | 124 // Create and return a PluginInstance object which supports the most recent |
| 121 // version of PPP_Instance possible by querying the given get_plugin_interface | 125 // version of PPP_Instance possible by querying the given get_plugin_interface |
| 122 // function. If the plugin does not support any valid PPP_Instance interface, | 126 // function. If the plugin does not support any valid PPP_Instance interface, |
| 123 // returns NULL. | 127 // returns NULL. |
| 124 static PluginInstance* Create(PluginDelegate* delegate, | 128 static PluginInstance* Create(PluginDelegate* delegate, |
| 129 content::RenderView* render_view, |
| 125 PluginModule* module, | 130 PluginModule* module, |
| 126 WebKit::WebPluginContainer* container, | 131 WebKit::WebPluginContainer* container, |
| 127 const GURL& plugin_url); | 132 const GURL& plugin_url); |
| 128 // Delete should be called by the WebPlugin before this destructor. | 133 // Delete should be called by the WebPlugin before this destructor. |
| 129 virtual ~PluginInstance(); | 134 virtual ~PluginInstance(); |
| 130 | 135 |
| 131 PluginDelegate* delegate() const { return delegate_; } | 136 PluginDelegate* delegate() const { return delegate_; } |
| 137 content::RenderView* render_view() const {return render_view_; } |
| 132 PluginModule* module() const { return module_.get(); } | 138 PluginModule* module() const { return module_.get(); } |
| 133 MessageChannel& message_channel() { return *message_channel_; } | 139 MessageChannel& message_channel() { return *message_channel_; } |
| 134 | 140 |
| 135 WebKit::WebPluginContainer* container() const { return container_; } | 141 WebKit::WebPluginContainer* container() const { return container_; } |
| 136 | 142 |
| 137 void set_always_on_top(bool on_top) { always_on_top_ = on_top; } | 143 void set_always_on_top(bool on_top) { always_on_top_ = on_top; } |
| 138 | 144 |
| 139 // Returns the PP_Instance uniquely identifying this instance. Guaranteed | 145 // Returns the PP_Instance uniquely identifying this instance. Guaranteed |
| 140 // nonzero. | 146 // nonzero. |
| 141 PP_Instance pp_instance() const { return pp_instance_; } | 147 PP_Instance pp_instance() const { return pp_instance_; } |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 PP_GamepadsSampleData* data) OVERRIDE; | 551 PP_GamepadsSampleData* data) OVERRIDE; |
| 546 private: | 552 private: |
| 547 PluginDelegate* delegate_; | 553 PluginDelegate* delegate_; |
| 548 }; | 554 }; |
| 549 | 555 |
| 550 // See the static Create functions above for creating PluginInstance objects. | 556 // See the static Create functions above for creating PluginInstance objects. |
| 551 // This constructor is private so that we can hide the PPP_Instance_Combined | 557 // This constructor is private so that we can hide the PPP_Instance_Combined |
| 552 // details while still having 1 constructor to maintain for member | 558 // details while still having 1 constructor to maintain for member |
| 553 // initialization. | 559 // initialization. |
| 554 PluginInstance(PluginDelegate* delegate, | 560 PluginInstance(PluginDelegate* delegate, |
| 561 content::RenderView* render_view, |
| 555 PluginModule* module, | 562 PluginModule* module, |
| 556 ::ppapi::PPP_Instance_Combined* instance_interface, | 563 ::ppapi::PPP_Instance_Combined* instance_interface, |
| 557 WebKit::WebPluginContainer* container, | 564 WebKit::WebPluginContainer* container, |
| 558 const GURL& plugin_url); | 565 const GURL& plugin_url); |
| 559 | 566 |
| 560 bool LoadFindInterface(); | 567 bool LoadFindInterface(); |
| 561 bool LoadInputEventInterface(); | 568 bool LoadInputEventInterface(); |
| 562 bool LoadMessagingInterface(); | 569 bool LoadMessagingInterface(); |
| 563 bool LoadMouseLockInterface(); | 570 bool LoadMouseLockInterface(); |
| 564 bool LoadPdfInterface(); | 571 bool LoadPdfInterface(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 // compositing path. | 641 // compositing path. |
| 635 bool IsViewAccelerated(); | 642 bool IsViewAccelerated(); |
| 636 | 643 |
| 637 // Track, set and reset size attributes to control the size of the plugin | 644 // Track, set and reset size attributes to control the size of the plugin |
| 638 // in and out of fullscreen mode. | 645 // in and out of fullscreen mode. |
| 639 void KeepSizeAttributesBeforeFullscreen(); | 646 void KeepSizeAttributesBeforeFullscreen(); |
| 640 void SetSizeAttributesForFullscreen(); | 647 void SetSizeAttributesForFullscreen(); |
| 641 void ResetSizeAttributesAfterFullscreen(); | 648 void ResetSizeAttributesAfterFullscreen(); |
| 642 | 649 |
| 643 PluginDelegate* delegate_; | 650 PluginDelegate* delegate_; |
| 651 content::RenderView* render_view_; |
| 644 scoped_refptr<PluginModule> module_; | 652 scoped_refptr<PluginModule> module_; |
| 645 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; | 653 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; |
| 646 // If this is the NaCl plugin, we create a new module when we switch to the | 654 // If this is the NaCl plugin, we create a new module when we switch to the |
| 647 // IPC-based PPAPI proxy. Store the original module and instance interface | 655 // IPC-based PPAPI proxy. Store the original module and instance interface |
| 648 // so we can shut down properly. | 656 // so we can shut down properly. |
| 649 scoped_refptr<PluginModule> original_module_; | 657 scoped_refptr<PluginModule> original_module_; |
| 650 scoped_ptr< ::ppapi::PPP_Instance_Combined> original_instance_interface_; | 658 scoped_ptr< ::ppapi::PPP_Instance_Combined> original_instance_interface_; |
| 651 | 659 |
| 652 PP_Instance pp_instance_; | 660 PP_Instance pp_instance_; |
| 653 | 661 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 v8::Isolate* isolate_; | 854 v8::Isolate* isolate_; |
| 847 | 855 |
| 848 friend class PpapiPluginInstanceTest; | 856 friend class PpapiPluginInstanceTest; |
| 849 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 857 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
| 850 }; | 858 }; |
| 851 | 859 |
| 852 } // namespace ppapi | 860 } // namespace ppapi |
| 853 } // namespace webkit | 861 } // namespace webkit |
| 854 | 862 |
| 855 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 863 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| OLD | NEW |