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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 &testing_interface, | 149 &testing_interface, |
150 PPB_TESTING_DEV_INTERFACE, | 150 PPB_TESTING_DEV_INTERFACE, |
151 API_ID_PPB_TESTING, | 151 API_ID_PPB_TESTING, |
152 false, | 152 false, |
153 &CreateTestingProxy, | 153 &CreateTestingProxy, |
154 }; | 154 }; |
155 return &info; | 155 return &info; |
156 } | 156 } |
157 | 157 |
158 bool PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) { | 158 bool PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) { |
159 if (!dispatcher()->permissions().HasPermission(PERMISSION_TESTING)) | |
bbudge
2012/12/07 22:23:41
Should we also allow this for the 'DEV' permission
| |
160 return false; | |
161 | |
159 bool handled = true; | 162 bool handled = true; |
160 IPC_BEGIN_MESSAGE_MAP(PPB_Testing_Proxy, msg) | 163 IPC_BEGIN_MESSAGE_MAP(PPB_Testing_Proxy, msg) |
161 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_ReadImageData, | 164 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_ReadImageData, |
162 OnMsgReadImageData) | 165 OnMsgReadImageData) |
163 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance, | 166 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance, |
164 OnMsgGetLiveObjectsForInstance) | 167 OnMsgGetLiveObjectsForInstance) |
165 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_SimulateInputEvent, | 168 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_SimulateInputEvent, |
166 OnMsgSimulateInputEvent) | 169 OnMsgSimulateInputEvent) |
167 IPC_MESSAGE_UNHANDLED(handled = false) | 170 IPC_MESSAGE_UNHANDLED(handled = false) |
168 IPC_END_MESSAGE_MAP() | 171 IPC_END_MESSAGE_MAP() |
(...skipping 26 matching lines...) Expand all Loading... | |
195 PP_Instance instance, | 198 PP_Instance instance, |
196 const InputEventData& input_event) { | 199 const InputEventData& input_event) { |
197 scoped_refptr<PPB_InputEvent_Shared> input_event_impl( | 200 scoped_refptr<PPB_InputEvent_Shared> input_event_impl( |
198 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event)); | 201 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event)); |
199 ppb_testing_impl_->SimulateInputEvent(instance, | 202 ppb_testing_impl_->SimulateInputEvent(instance, |
200 input_event_impl->pp_resource()); | 203 input_event_impl->pp_resource()); |
201 } | 204 } |
202 | 205 |
203 } // namespace proxy | 206 } // namespace proxy |
204 } // namespace ppapi | 207 } // namespace ppapi |
OLD | NEW |