OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_testing_proxy.h" | 5 #include "ppapi/proxy/ppb_testing_proxy.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "ppapi/c/dev/ppb_testing_dev.h" | 8 #include "ppapi/c/dev/ppb_testing_dev.h" |
9 #include "ppapi/proxy/enter_proxy.h" | 9 #include "ppapi/proxy/enter_proxy.h" |
10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 &testing_interface, | 150 &testing_interface, |
151 PPB_TESTING_DEV_INTERFACE, | 151 PPB_TESTING_DEV_INTERFACE, |
152 API_ID_PPB_TESTING, | 152 API_ID_PPB_TESTING, |
153 false, | 153 false, |
154 &CreateTestingProxy, | 154 &CreateTestingProxy, |
155 }; | 155 }; |
156 return &info; | 156 return &info; |
157 } | 157 } |
158 | 158 |
159 bool PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) { | 159 bool PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 160 if (!dispatcher()->permissions().HasPermission(PERMISSION_TESTING)) |
| 161 return false; |
| 162 |
160 bool handled = true; | 163 bool handled = true; |
161 IPC_BEGIN_MESSAGE_MAP(PPB_Testing_Proxy, msg) | 164 IPC_BEGIN_MESSAGE_MAP(PPB_Testing_Proxy, msg) |
162 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_ReadImageData, | 165 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_ReadImageData, |
163 OnMsgReadImageData) | 166 OnMsgReadImageData) |
164 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance, | 167 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance, |
165 OnMsgGetLiveObjectsForInstance) | 168 OnMsgGetLiveObjectsForInstance) |
166 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_SimulateInputEvent, | 169 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_SimulateInputEvent, |
167 OnMsgSimulateInputEvent) | 170 OnMsgSimulateInputEvent) |
168 IPC_MESSAGE_UNHANDLED(handled = false) | 171 IPC_MESSAGE_UNHANDLED(handled = false) |
169 IPC_END_MESSAGE_MAP() | 172 IPC_END_MESSAGE_MAP() |
(...skipping 26 matching lines...) Expand all Loading... |
196 PP_Instance instance, | 199 PP_Instance instance, |
197 const InputEventData& input_event) { | 200 const InputEventData& input_event) { |
198 scoped_refptr<PPB_InputEvent_Shared> input_event_impl( | 201 scoped_refptr<PPB_InputEvent_Shared> input_event_impl( |
199 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event)); | 202 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event)); |
200 ppb_testing_impl_->SimulateInputEvent(instance, | 203 ppb_testing_impl_->SimulateInputEvent(instance, |
201 input_event_impl->pp_resource()); | 204 input_event_impl->pp_resource()); |
202 } | 205 } |
203 | 206 |
204 } // namespace proxy | 207 } // namespace proxy |
205 } // namespace ppapi | 208 } // namespace ppapi |
OLD | NEW |