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 #include "ppapi/proxy/ppb_cursor_control_proxy.h" | 5 #include "ppapi/proxy/ppb_cursor_control_proxy.h" |
6 | 6 |
7 #include "ppapi/c/dev/pp_cursor_type_dev.h" | 7 #include "ppapi/c/dev/pp_cursor_type_dev.h" |
8 #include "ppapi/c/dev/ppb_cursor_control_dev.h" | 8 #include "ppapi/c/dev/ppb_cursor_control_dev.h" |
9 #include "ppapi/proxy/plugin_dispatcher.h" | 9 #include "ppapi/proxy/plugin_dispatcher.h" |
10 #include "ppapi/proxy/plugin_resource_tracker.h" | 10 #include "ppapi/proxy/plugin_resource_tracker.h" |
11 #include "ppapi/proxy/ppapi_messages.h" | 11 #include "ppapi/proxy/ppapi_messages.h" |
12 #include "ppapi/thunk/enter.h" | 12 #include "ppapi/thunk/enter.h" |
13 #include "ppapi/thunk/thunk.h" | 13 #include "ppapi/thunk/thunk.h" |
14 | 14 |
15 using ppapi::thunk::EnterFunctionNoLock; | 15 using ppapi::thunk::EnterFunctionNoLock; |
16 using ppapi::thunk::PPB_CursorControl_FunctionAPI; | 16 using ppapi::thunk::PPB_CursorControl_FunctionAPI; |
17 | 17 |
18 namespace ppapi { | 18 namespace ppapi { |
19 namespace proxy { | 19 namespace proxy { |
20 | 20 |
21 PPB_CursorControl_Proxy::PPB_CursorControl_Proxy(Dispatcher* dispatcher) | 21 namespace { |
22 : InterfaceProxy(dispatcher) { | 22 |
| 23 InterfaceProxy* CreateCursorControlProxy(Dispatcher* dispatcher, |
| 24 const void* target_interface) { |
| 25 return new PPB_CursorControl_Proxy(dispatcher, target_interface); |
| 26 } |
| 27 |
| 28 } // namespace |
| 29 |
| 30 PPB_CursorControl_Proxy::PPB_CursorControl_Proxy(Dispatcher* dispatcher, |
| 31 const void* target_interface) |
| 32 : InterfaceProxy(dispatcher, target_interface) { |
23 } | 33 } |
24 | 34 |
25 PPB_CursorControl_Proxy::~PPB_CursorControl_Proxy() { | 35 PPB_CursorControl_Proxy::~PPB_CursorControl_Proxy() { |
26 } | 36 } |
27 | 37 |
| 38 // static |
| 39 const InterfaceProxy::Info* PPB_CursorControl_Proxy::GetInfo() { |
| 40 static const Info info = { |
| 41 thunk::GetPPB_CursorControl_Thunk(), |
| 42 PPB_CURSOR_CONTROL_DEV_INTERFACE, |
| 43 INTERFACE_ID_PPB_CURSORCONTROL, |
| 44 false, |
| 45 &CreateCursorControlProxy, |
| 46 }; |
| 47 return &info; |
| 48 } |
| 49 |
28 ppapi::thunk::PPB_CursorControl_FunctionAPI* | 50 ppapi::thunk::PPB_CursorControl_FunctionAPI* |
29 PPB_CursorControl_Proxy::AsPPB_CursorControl_FunctionAPI() { | 51 PPB_CursorControl_Proxy::AsPPB_CursorControl_FunctionAPI() { |
30 return this; | 52 return this; |
31 } | 53 } |
32 | 54 |
33 PP_Bool PPB_CursorControl_Proxy::SetCursor(PP_Instance instance, | 55 PP_Bool PPB_CursorControl_Proxy::SetCursor(PP_Instance instance, |
34 PP_CursorType_Dev type, | 56 PP_CursorType_Dev type, |
35 PP_Resource custom_image_id, | 57 PP_Resource custom_image_id, |
36 const PP_Point* hot_spot) { | 58 const PP_Point* hot_spot) { |
37 // It's legal for the image ID to be null if the type is not custom. | 59 // It's legal for the image ID to be null if the type is not custom. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 161 |
140 void PPB_CursorControl_Proxy::OnMsgCanLockCursor(PP_Instance instance, | 162 void PPB_CursorControl_Proxy::OnMsgCanLockCursor(PP_Instance instance, |
141 PP_Bool* result) { | 163 PP_Bool* result) { |
142 EnterFunctionNoLock<PPB_CursorControl_FunctionAPI> enter(instance, true); | 164 EnterFunctionNoLock<PPB_CursorControl_FunctionAPI> enter(instance, true); |
143 if (enter.succeeded()) | 165 if (enter.succeeded()) |
144 *result = enter.functions()->CanLockCursor(instance); | 166 *result = enter.functions()->CanLockCursor(instance); |
145 } | 167 } |
146 | 168 |
147 } // namespace proxy | 169 } // namespace proxy |
148 } // namespace ppapi | 170 } // namespace ppapi |
OLD | NEW |