OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
7 | 7 |
8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
11 #include "ppapi/proxy/interface_proxy.h" | 11 #include "ppapi/proxy/interface_proxy.h" |
12 #include "ppapi/shared_impl/function_group_base.h" | 12 #include "ppapi/shared_impl/function_group_base.h" |
13 #include "ppapi/shared_impl/host_resource.h" | 13 #include "ppapi/shared_impl/host_resource.h" |
14 #include "ppapi/shared_impl/instance_impl.h" | 14 #include "ppapi/shared_impl/instance_impl.h" |
15 #include "ppapi/thunk/ppb_instance_api.h" | 15 #include "ppapi/thunk/ppb_instance_api.h" |
16 | 16 |
17 namespace ppapi { | 17 namespace ppapi { |
18 namespace proxy { | 18 namespace proxy { |
19 | 19 |
20 class SerializedVarReceiveInput; | 20 class SerializedVarReceiveInput; |
21 class SerializedVarOutParam; | 21 class SerializedVarOutParam; |
22 class SerializedVarReturnValue; | 22 class SerializedVarReturnValue; |
23 | 23 |
24 class PPB_Instance_Proxy : public InterfaceProxy, | 24 class PPB_Instance_Proxy : public InterfaceProxy, |
25 public ppapi::InstanceImpl, | 25 public ppapi::InstanceImpl, |
| 26 public ppapi::FunctionGroupBase, |
26 public ppapi::thunk::PPB_Instance_FunctionAPI { | 27 public ppapi::thunk::PPB_Instance_FunctionAPI { |
27 public: | 28 public: |
28 PPB_Instance_Proxy(Dispatcher* dispatcher); | 29 PPB_Instance_Proxy(Dispatcher* dispatcher, const void* target_interface); |
29 virtual ~PPB_Instance_Proxy(); | 30 virtual ~PPB_Instance_Proxy(); |
30 | 31 |
| 32 static const Info* GetInfo0_5(); |
| 33 static const Info* GetInfo1_0(); |
| 34 static const Info* GetInfoMessaging(); |
| 35 static const Info* GetInfoMouseLock(); |
31 static const Info* GetInfoPrivate(); | 36 static const Info* GetInfoPrivate(); |
32 static const Info* GetInfoFullscreen(); | 37 static const Info* GetInfoFullscreen(); |
33 | 38 |
34 // InterfaceProxy implementation. | 39 // InterfaceProxy implementation. |
35 virtual bool OnMessageReceived(const IPC::Message& msg); | 40 virtual bool OnMessageReceived(const IPC::Message& msg); |
36 | 41 |
37 // FunctionGroupBase overrides. | 42 // FunctionGroupBase overrides. |
38 ppapi::thunk::PPB_Instance_FunctionAPI* AsPPB_Instance_FunctionAPI() OVERRIDE; | 43 ppapi::thunk::PPB_Instance_FunctionAPI* AsPPB_Instance_FunctionAPI() OVERRIDE; |
39 | 44 |
40 // PPB_Instance_FunctionAPI implementation. | 45 // PPB_Instance_FunctionAPI implementation. |
41 virtual PP_Bool BindGraphics(PP_Instance instance, | 46 virtual PP_Bool BindGraphics(PP_Instance instance, |
42 PP_Resource device) OVERRIDE; | 47 PP_Resource device) OVERRIDE; |
43 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; | 48 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; |
44 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; | 49 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; |
45 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; | 50 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; |
46 virtual PP_Var ExecuteScript(PP_Instance instance, | 51 virtual PP_Var ExecuteScript(PP_Instance instance, |
47 PP_Var script, | 52 PP_Var script, |
48 PP_Var* exception) OVERRIDE; | 53 PP_Var* exception) OVERRIDE; |
49 virtual void Log(PP_Instance instance, | |
50 int log_level, | |
51 PP_Var value) OVERRIDE; | |
52 virtual void LogWithSource(PP_Instance instance, | |
53 int log_level, | |
54 PP_Var source, | |
55 PP_Var value) OVERRIDE; | |
56 virtual PP_Bool IsFullscreen(PP_Instance instance) OVERRIDE; | 54 virtual PP_Bool IsFullscreen(PP_Instance instance) OVERRIDE; |
57 virtual PP_Bool SetFullscreen(PP_Instance instance, | 55 virtual PP_Bool SetFullscreen(PP_Instance instance, |
58 PP_Bool fullscreen) OVERRIDE; | 56 PP_Bool fullscreen) OVERRIDE; |
59 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) OVERRIDE; | 57 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) OVERRIDE; |
60 virtual int32_t RequestInputEvents(PP_Instance instance, | 58 virtual int32_t RequestInputEvents(PP_Instance instance, |
61 uint32_t event_classes) OVERRIDE; | 59 uint32_t event_classes) OVERRIDE; |
62 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, | 60 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, |
63 uint32_t event_classes) OVERRIDE; | 61 uint32_t event_classes) OVERRIDE; |
64 virtual void ClearInputEventRequest(PP_Instance instance, | 62 virtual void ClearInputEventRequest(PP_Instance instance, |
65 uint32_t event_classes) OVERRIDE; | 63 uint32_t event_classes) OVERRIDE; |
66 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; | 64 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; |
67 virtual void ZoomLimitsChanged(PP_Instance instance, | 65 virtual void ZoomLimitsChanged(PP_Instance instance, |
68 double minimum_factor, | 66 double minimum_factor, |
69 double maximium_factor) OVERRIDE; | 67 double maximium_factor) OVERRIDE; |
70 virtual void SubscribeToPolicyUpdates(PP_Instance instance) OVERRIDE; | 68 virtual void SubscribeToPolicyUpdates(PP_Instance instance) OVERRIDE; |
71 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; | 69 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; |
72 virtual int32_t LockMouse(PP_Instance instance, | 70 virtual int32_t LockMouse(PP_Instance instance, |
73 PP_CompletionCallback callback) OVERRIDE; | 71 PP_CompletionCallback callback) OVERRIDE; |
74 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; | 72 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; |
75 | 73 |
76 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_INSTANCE; | |
77 | |
78 private: | 74 private: |
79 // Message handlers. | 75 // Message handlers. |
80 void OnMsgGetWindowObject(PP_Instance instance, | 76 void OnMsgGetWindowObject(PP_Instance instance, |
81 SerializedVarReturnValue result); | 77 SerializedVarReturnValue result); |
82 void OnMsgGetOwnerElementObject(PP_Instance instance, | 78 void OnMsgGetOwnerElementObject(PP_Instance instance, |
83 SerializedVarReturnValue result); | 79 SerializedVarReturnValue result); |
84 void OnMsgBindGraphics(PP_Instance instance, | 80 void OnMsgBindGraphics(PP_Instance instance, |
85 const ppapi::HostResource& device, | 81 const ppapi::HostResource& device, |
86 PP_Bool* result); | 82 PP_Bool* result); |
87 void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result); | 83 void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result); |
88 void OnMsgExecuteScript(PP_Instance instance, | 84 void OnMsgExecuteScript(PP_Instance instance, |
89 SerializedVarReceiveInput script, | 85 SerializedVarReceiveInput script, |
90 SerializedVarOutParam out_exception, | 86 SerializedVarOutParam out_exception, |
91 SerializedVarReturnValue result); | 87 SerializedVarReturnValue result); |
92 void OnMsgLog(PP_Instance instance, | |
93 int log_level, | |
94 SerializedVarReceiveInput value); | |
95 void OnMsgLogWithSource(PP_Instance instance, | |
96 int log_level, | |
97 SerializedVarReceiveInput source, | |
98 SerializedVarReceiveInput value); | |
99 void OnMsgSetFullscreen(PP_Instance instance, | 88 void OnMsgSetFullscreen(PP_Instance instance, |
100 PP_Bool fullscreen, | 89 PP_Bool fullscreen, |
101 PP_Bool* result); | 90 PP_Bool* result); |
102 void OnMsgGetScreenSize(PP_Instance instance, | 91 void OnMsgGetScreenSize(PP_Instance instance, |
103 PP_Bool* result, | 92 PP_Bool* result, |
104 PP_Size* size); | 93 PP_Size* size); |
105 void OnMsgRequestInputEvents(PP_Instance instance, | 94 void OnMsgRequestInputEvents(PP_Instance instance, |
106 bool is_filtering, | 95 bool is_filtering, |
107 uint32_t event_classes); | 96 uint32_t event_classes); |
108 void OnMsgClearInputEvents(PP_Instance instance, | 97 void OnMsgClearInputEvents(PP_Instance instance, |
109 uint32_t event_classes); | 98 uint32_t event_classes); |
110 void OnMsgPostMessage(PP_Instance instance, | 99 void OnMsgPostMessage(PP_Instance instance, |
111 SerializedVarReceiveInput message); | 100 SerializedVarReceiveInput message); |
112 void OnMsgLockMouse(PP_Instance instance, | 101 void OnMsgLockMouse(PP_Instance instance, |
113 uint32_t serialized_callback); | 102 uint32_t serialized_callback); |
114 void OnMsgUnlockMouse(PP_Instance instance); | 103 void OnMsgUnlockMouse(PP_Instance instance); |
115 }; | 104 }; |
116 | 105 |
117 } // namespace proxy | 106 } // namespace proxy |
118 } // namespace ppapi | 107 } // namespace ppapi |
119 | 108 |
120 #endif // PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ | 109 #endif // PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
OLD | NEW |