OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/ppb_cursor_control_dev.h" | 7 #include "ppapi/c/dev/ppb_cursor_control_dev.h" |
8 #include "ppapi/proxy/plugin_dispatcher.h" | 8 #include "ppapi/proxy/plugin_dispatcher.h" |
9 #include "ppapi/proxy/ppapi_messages.h" | 9 #include "ppapi/proxy/ppapi_messages.h" |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 73 } |
74 | 74 |
75 const void* PPB_CursorControl_Proxy::GetSourceInterface() const { | 75 const void* PPB_CursorControl_Proxy::GetSourceInterface() const { |
76 return &cursor_control_interface; | 76 return &cursor_control_interface; |
77 } | 77 } |
78 | 78 |
79 InterfaceID PPB_CursorControl_Proxy::GetInterfaceId() const { | 79 InterfaceID PPB_CursorControl_Proxy::GetInterfaceId() const { |
80 return INTERFACE_ID_PPB_CURSORCONTROL; | 80 return INTERFACE_ID_PPB_CURSORCONTROL; |
81 } | 81 } |
82 | 82 |
83 void PPB_CursorControl_Proxy::OnMessageReceived(const IPC::Message& msg) { | 83 bool PPB_CursorControl_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 84 bool handled = true; |
84 IPC_BEGIN_MESSAGE_MAP(PPB_CursorControl_Proxy, msg) | 85 IPC_BEGIN_MESSAGE_MAP(PPB_CursorControl_Proxy, msg) |
85 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_SetCursor, | 86 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_SetCursor, |
86 OnMsgSetCursor) | 87 OnMsgSetCursor) |
87 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_LockCursor, | 88 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_LockCursor, |
88 OnMsgLockCursor) | 89 OnMsgLockCursor) |
89 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_UnlockCursor, | 90 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_UnlockCursor, |
90 OnMsgUnlockCursor) | 91 OnMsgUnlockCursor) |
91 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_HasCursorLock, | 92 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_HasCursorLock, |
92 OnMsgHasCursorLock) | 93 OnMsgHasCursorLock) |
93 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_CanLockCursor, | 94 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_CanLockCursor, |
94 OnMsgCanLockCursor) | 95 OnMsgCanLockCursor) |
| 96 IPC_MESSAGE_UNHANDLED(handled = false) |
95 IPC_END_MESSAGE_MAP() | 97 IPC_END_MESSAGE_MAP() |
96 // TODO(brettw): handle bad messages! | 98 // TODO(brettw): handle bad messages! |
| 99 return handled; |
97 } | 100 } |
98 | 101 |
99 void PPB_CursorControl_Proxy::OnMsgSetCursor(PP_Instance instance, | 102 void PPB_CursorControl_Proxy::OnMsgSetCursor(PP_Instance instance, |
100 int32_t type, | 103 int32_t type, |
101 PP_Resource custom_image, | 104 PP_Resource custom_image, |
102 const PP_Point& hot_spot, | 105 const PP_Point& hot_spot, |
103 PP_Bool* result) { | 106 PP_Bool* result) { |
104 *result = ppb_cursor_control_target()->SetCursor( | 107 *result = ppb_cursor_control_target()->SetCursor( |
105 instance, static_cast<PP_CursorType_Dev>(type), custom_image, &hot_spot); | 108 instance, static_cast<PP_CursorType_Dev>(type), custom_image, &hot_spot); |
106 } | 109 } |
(...skipping 13 matching lines...) Expand all Loading... |
120 *result = ppb_cursor_control_target()->HasCursorLock(instance); | 123 *result = ppb_cursor_control_target()->HasCursorLock(instance); |
121 } | 124 } |
122 | 125 |
123 void PPB_CursorControl_Proxy::OnMsgCanLockCursor(PP_Instance instance, | 126 void PPB_CursorControl_Proxy::OnMsgCanLockCursor(PP_Instance instance, |
124 PP_Bool* result) { | 127 PP_Bool* result) { |
125 *result = ppb_cursor_control_target()->CanLockCursor(instance); | 128 *result = ppb_cursor_control_target()->CanLockCursor(instance); |
126 } | 129 } |
127 | 130 |
128 } // namespace proxy | 131 } // namespace proxy |
129 } // namespace pp | 132 } // namespace pp |
OLD | NEW |