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