Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: ppapi/proxy/ppb_testing_proxy.cc

Issue 8413021: Add functions to generate input events to PPB_Testing_Dev. These make (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/proxy/ppb_testing_proxy.cc
===================================================================
--- ppapi/proxy/ppb_testing_proxy.cc (revision 108154)
+++ ppapi/proxy/ppb_testing_proxy.cc (working copy)
@@ -7,6 +7,7 @@
#include "base/message_loop.h"
#include "ppapi/c/dev/ppb_testing_dev.h"
#include "ppapi/proxy/plugin_dispatcher.h"
+#include "ppapi/proxy/plugin_globals.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/resource.h"
@@ -68,12 +69,23 @@
return PP_TRUE;
}
+void SimulateInputEvent(PP_Instance instance_id, PP_Resource input_event) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
+ if (!dispatcher)
+ return;
+ HostResource input_event_resource;
+ input_event_resource.SetHostResource(instance_id, input_event);
+ dispatcher->Send(new PpapiHostMsg_PPBTesting_SimulateInputEvent(
+ API_ID_PPB_TESTING, instance_id, input_event_resource));
+}
+
const PPB_Testing_Dev testing_interface = {
&ReadImageData,
&RunMessageLoop,
&QuitMessageLoop,
&GetLiveObjectsForInstance,
- &IsOutOfProcess
+ &IsOutOfProcess,
+ &SimulateInputEvent
};
InterfaceProxy* CreateTestingProxy(Dispatcher* dispatcher) {
@@ -113,6 +125,8 @@
OnMsgReadImageData)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance,
OnMsgGetLiveObjectsForInstance)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_SimulateInputEvent,
+ OnMsgSimulateInputEvent)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -140,5 +154,14 @@
*result = ppb_testing_impl_->GetLiveObjectsForInstance(instance);
}
+void PPB_Testing_Proxy::OnMsgSimulateInputEvent(
+ PP_Instance instance,
+ const ppapi::HostResource& input_event) {
+ PP_Resource plugin_input_event =
+ PluginGlobals::Get()->plugin_resource_tracker()->
+ PluginResourceForHostResource(input_event);
+ ppb_testing_impl_->SimulateInputEvent(instance, plugin_input_event);
+}
+
} // namespace proxy
} // namespace ppapi

Powered by Google App Engine
This is Rietveld 408576698