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 namespace { | 21 PPB_CursorControl_Proxy::PPB_CursorControl_Proxy(Dispatcher* dispatcher) |
22 | 22 : InterfaceProxy(dispatcher) { |
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) { | |
33 } | 23 } |
34 | 24 |
35 PPB_CursorControl_Proxy::~PPB_CursorControl_Proxy() { | 25 PPB_CursorControl_Proxy::~PPB_CursorControl_Proxy() { |
36 } | 26 } |
37 | 27 |
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 | |
50 ppapi::thunk::PPB_CursorControl_FunctionAPI* | 28 ppapi::thunk::PPB_CursorControl_FunctionAPI* |
51 PPB_CursorControl_Proxy::AsPPB_CursorControl_FunctionAPI() { | 29 PPB_CursorControl_Proxy::AsPPB_CursorControl_FunctionAPI() { |
52 return this; | 30 return this; |
53 } | 31 } |
54 | 32 |
55 PP_Bool PPB_CursorControl_Proxy::SetCursor(PP_Instance instance, | 33 PP_Bool PPB_CursorControl_Proxy::SetCursor(PP_Instance instance, |
56 PP_CursorType_Dev type, | 34 PP_CursorType_Dev type, |
57 PP_Resource custom_image_id, | 35 PP_Resource custom_image_id, |
58 const PP_Point* hot_spot) { | 36 const PP_Point* hot_spot) { |
59 // It's legal for the image ID to be null if the type is not custom. | 37 // 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... |
161 | 139 |
162 void PPB_CursorControl_Proxy::OnMsgCanLockCursor(PP_Instance instance, | 140 void PPB_CursorControl_Proxy::OnMsgCanLockCursor(PP_Instance instance, |
163 PP_Bool* result) { | 141 PP_Bool* result) { |
164 EnterFunctionNoLock<PPB_CursorControl_FunctionAPI> enter(instance, true); | 142 EnterFunctionNoLock<PPB_CursorControl_FunctionAPI> enter(instance, true); |
165 if (enter.succeeded()) | 143 if (enter.succeeded()) |
166 *result = enter.functions()->CanLockCursor(instance); | 144 *result = enter.functions()->CanLockCursor(instance); |
167 } | 145 } |
168 | 146 |
169 } // namespace proxy | 147 } // namespace proxy |
170 } // namespace ppapi | 148 } // namespace ppapi |
OLD | NEW |