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 CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
18 #include "cc/layers/texture_layer_client.h" | 18 #include "cc/layers/texture_layer_client.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/public/renderer/pepper_plugin_instance.h" | 20 #include "content/public/renderer/pepper_plugin_instance.h" |
| 21 #include "content/renderer/mouse_lock_dispatcher.h" |
21 #include "content/renderer/pepper/plugin_delegate.h" | 22 #include "content/renderer/pepper/plugin_delegate.h" |
22 #include "content/renderer/pepper/ppp_pdf.h" | 23 #include "content/renderer/pepper/ppp_pdf.h" |
23 #include "ppapi/c/dev/pp_cursor_type_dev.h" | 24 #include "ppapi/c/dev/pp_cursor_type_dev.h" |
24 #include "ppapi/c/dev/ppp_find_dev.h" | 25 #include "ppapi/c/dev/ppp_find_dev.h" |
25 #include "ppapi/c/dev/ppp_printing_dev.h" | 26 #include "ppapi/c/dev/ppp_printing_dev.h" |
26 #include "ppapi/c/dev/ppp_selection_dev.h" | 27 #include "ppapi/c/dev/ppp_selection_dev.h" |
27 #include "ppapi/c/dev/ppp_text_input_dev.h" | 28 #include "ppapi/c/dev/ppp_text_input_dev.h" |
28 #include "ppapi/c/dev/ppp_zoom_dev.h" | 29 #include "ppapi/c/dev/ppp_zoom_dev.h" |
29 #include "ppapi/c/pp_completion_callback.h" | 30 #include "ppapi/c/pp_completion_callback.h" |
30 #include "ppapi/c/pp_instance.h" | 31 #include "ppapi/c/pp_instance.h" |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 // Returns true if the WebView the plugin is in renders via the accelerated | 634 // Returns true if the WebView the plugin is in renders via the accelerated |
634 // compositing path. | 635 // compositing path. |
635 bool IsViewAccelerated(); | 636 bool IsViewAccelerated(); |
636 | 637 |
637 // Track, set and reset size attributes to control the size of the plugin | 638 // Track, set and reset size attributes to control the size of the plugin |
638 // in and out of fullscreen mode. | 639 // in and out of fullscreen mode. |
639 void KeepSizeAttributesBeforeFullscreen(); | 640 void KeepSizeAttributesBeforeFullscreen(); |
640 void SetSizeAttributesForFullscreen(); | 641 void SetSizeAttributesForFullscreen(); |
641 void ResetSizeAttributesAfterFullscreen(); | 642 void ResetSizeAttributesAfterFullscreen(); |
642 | 643 |
| 644 bool IsMouseLocked(); |
| 645 bool LockMouse(); |
| 646 MouseLockDispatcher* GetMouseLockDispatcher(); |
| 647 MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter(); |
| 648 void UnSetAndDeleteLockTargetAdapter(); |
| 649 |
643 PluginDelegate* delegate_; | 650 PluginDelegate* delegate_; |
644 RenderViewImpl* render_view_; | 651 RenderViewImpl* render_view_; |
645 scoped_refptr<PluginModule> module_; | 652 scoped_refptr<PluginModule> module_; |
646 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; | 653 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; |
647 // 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 |
648 // IPC-based PPAPI proxy. Store the original module and instance interface | 655 // IPC-based PPAPI proxy. Store the original module and instance interface |
649 // so we can shut down properly. | 656 // so we can shut down properly. |
650 scoped_refptr<PluginModule> original_module_; | 657 scoped_refptr<PluginModule> original_module_; |
651 scoped_ptr< ::ppapi::PPP_Instance_Combined> original_instance_interface_; | 658 scoped_ptr< ::ppapi::PPP_Instance_Combined> original_instance_interface_; |
652 | 659 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 scoped_ptr<ContentDecryptorDelegate> content_decryptor_delegate_; | 846 scoped_ptr<ContentDecryptorDelegate> content_decryptor_delegate_; |
840 | 847 |
841 // Dummy NPP value used when calling in to WebBindings, to allow the bindings | 848 // Dummy NPP value used when calling in to WebBindings, to allow the bindings |
842 // to correctly track NPObjects belonging to this plugin instance. | 849 // to correctly track NPObjects belonging to this plugin instance. |
843 scoped_ptr<struct _NPP> npp_; | 850 scoped_ptr<struct _NPP> npp_; |
844 | 851 |
845 // We store the isolate at construction so that we can be sure to use the | 852 // We store the isolate at construction so that we can be sure to use the |
846 // Isolate in which this Instance was created when interacting with v8. | 853 // Isolate in which this Instance was created when interacting with v8. |
847 v8::Isolate* isolate_; | 854 v8::Isolate* isolate_; |
848 | 855 |
| 856 scoped_ptr<MouseLockDispatcher::LockTarget> lock_target_; |
| 857 |
849 friend class PpapiPluginInstanceTest; | 858 friend class PpapiPluginInstanceTest; |
850 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); | 859 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); |
851 }; | 860 }; |
852 | 861 |
853 } // namespace content | 862 } // namespace content |
854 | 863 |
855 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 864 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
OLD | NEW |