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/cpp/completion_callback.h" | |
11 #include "ppapi/proxy/interface_proxy.h" | 12 #include "ppapi/proxy/interface_proxy.h" |
13 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" | |
12 #include "ppapi/shared_impl/function_group_base.h" | 14 #include "ppapi/shared_impl/function_group_base.h" |
13 #include "ppapi/shared_impl/host_resource.h" | 15 #include "ppapi/shared_impl/host_resource.h" |
14 #include "ppapi/shared_impl/instance_impl.h" | 16 #include "ppapi/shared_impl/instance_impl.h" |
15 #include "ppapi/thunk/ppb_instance_api.h" | 17 #include "ppapi/thunk/ppb_instance_api.h" |
16 | 18 |
19 // Windows headers interfere with this file. | |
20 #ifdef PostMessage | |
21 #undef PostMessage | |
viettrungluu
2011/10/20 23:29:46
This makes this header incompatible with using Win
| |
22 #endif | |
23 | |
17 namespace ppapi { | 24 namespace ppapi { |
18 namespace proxy { | 25 namespace proxy { |
19 | 26 |
20 class SerializedVarReceiveInput; | 27 class SerializedVarReceiveInput; |
21 class SerializedVarOutParam; | 28 class SerializedVarOutParam; |
22 class SerializedVarReturnValue; | 29 class SerializedVarReturnValue; |
23 | 30 |
24 class PPB_Instance_Proxy : public InterfaceProxy, | 31 class PPB_Instance_Proxy : public InterfaceProxy, |
25 public ppapi::InstanceImpl, | 32 public ppapi::InstanceImpl, |
26 public ppapi::thunk::PPB_Instance_FunctionAPI { | 33 public ppapi::thunk::PPB_Instance_FunctionAPI { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 PP_Instance instance, | 99 PP_Instance instance, |
93 PP_URLComponents_Dev* components) OVERRIDE; | 100 PP_URLComponents_Dev* components) OVERRIDE; |
94 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; | 101 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; |
95 virtual int32_t LockMouse(PP_Instance instance, | 102 virtual int32_t LockMouse(PP_Instance instance, |
96 PP_CompletionCallback callback) OVERRIDE; | 103 PP_CompletionCallback callback) OVERRIDE; |
97 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; | 104 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; |
98 | 105 |
99 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_INSTANCE; | 106 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_INSTANCE; |
100 | 107 |
101 private: | 108 private: |
102 // Message handlers. | 109 // Plugin -> Host message handlers. |
103 void OnMsgGetWindowObject(PP_Instance instance, | 110 void OnMsgGetWindowObject(PP_Instance instance, |
104 SerializedVarReturnValue result); | 111 SerializedVarReturnValue result); |
105 void OnMsgGetOwnerElementObject(PP_Instance instance, | 112 void OnMsgGetOwnerElementObject(PP_Instance instance, |
106 SerializedVarReturnValue result); | 113 SerializedVarReturnValue result); |
107 void OnMsgBindGraphics(PP_Instance instance, | 114 void OnMsgBindGraphics(PP_Instance instance, |
108 const ppapi::HostResource& device, | 115 const ppapi::HostResource& device, |
109 PP_Bool* result); | 116 PP_Bool* result); |
110 void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result); | 117 void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result); |
111 void OnMsgExecuteScript(PP_Instance instance, | 118 void OnMsgExecuteScript(PP_Instance instance, |
112 SerializedVarReceiveInput script, | 119 SerializedVarReceiveInput script, |
(...skipping 20 matching lines...) Expand all Loading... | |
133 void OnMsgFlashGetScreenSize(PP_Instance instance, | 140 void OnMsgFlashGetScreenSize(PP_Instance instance, |
134 PP_Bool* result, | 141 PP_Bool* result, |
135 PP_Size* size); | 142 PP_Size* size); |
136 void OnMsgRequestInputEvents(PP_Instance instance, | 143 void OnMsgRequestInputEvents(PP_Instance instance, |
137 bool is_filtering, | 144 bool is_filtering, |
138 uint32_t event_classes); | 145 uint32_t event_classes); |
139 void OnMsgClearInputEvents(PP_Instance instance, | 146 void OnMsgClearInputEvents(PP_Instance instance, |
140 uint32_t event_classes); | 147 uint32_t event_classes); |
141 void OnMsgPostMessage(PP_Instance instance, | 148 void OnMsgPostMessage(PP_Instance instance, |
142 SerializedVarReceiveInput message); | 149 SerializedVarReceiveInput message); |
143 void OnMsgLockMouse(PP_Instance instance, | 150 void OnMsgLockMouse(PP_Instance instance); |
144 uint32_t serialized_callback); | |
145 void OnMsgUnlockMouse(PP_Instance instance); | 151 void OnMsgUnlockMouse(PP_Instance instance); |
146 void OnMsgResolveRelativeToDocument(PP_Instance instance, | 152 void OnMsgResolveRelativeToDocument(PP_Instance instance, |
147 SerializedVarReceiveInput relative, | 153 SerializedVarReceiveInput relative, |
148 SerializedVarReturnValue result); | 154 SerializedVarReturnValue result); |
149 void OnMsgDocumentCanRequest(PP_Instance instance, | 155 void OnMsgDocumentCanRequest(PP_Instance instance, |
150 SerializedVarReceiveInput url, | 156 SerializedVarReceiveInput url, |
151 PP_Bool* result); | 157 PP_Bool* result); |
152 void OnMsgDocumentCanAccessDocument(PP_Instance active, | 158 void OnMsgDocumentCanAccessDocument(PP_Instance active, |
153 PP_Instance target, | 159 PP_Instance target, |
154 PP_Bool* result); | 160 PP_Bool* result); |
155 void OnMsgGetDocumentURL(PP_Instance instance, | 161 void OnMsgGetDocumentURL(PP_Instance instance, |
156 SerializedVarReturnValue result); | 162 SerializedVarReturnValue result); |
157 void OnMsgGetPluginInstanceURL(PP_Instance instance, | 163 void OnMsgGetPluginInstanceURL(PP_Instance instance, |
158 SerializedVarReturnValue result); | 164 SerializedVarReturnValue result); |
165 | |
166 // Host -> Plugin message handlers. | |
167 void OnMsgMouseLockComplete(PP_Instance instance, int32_t result); | |
168 | |
169 void MouseLockCompleteInHost(int32_t result, PP_Instance instance); | |
170 | |
171 pp::CompletionCallbackFactory<PPB_Instance_Proxy, | |
172 ProxyNonThreadSafeRefCount> callback_factory_; | |
159 }; | 173 }; |
160 | 174 |
161 } // namespace proxy | 175 } // namespace proxy |
162 } // namespace ppapi | 176 } // namespace ppapi |
163 | 177 |
164 #endif // PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ | 178 #endif // PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
OLD | NEW |