Index: ppapi/proxy/ppb_instance_proxy.cc |
=================================================================== |
--- ppapi/proxy/ppb_instance_proxy.cc (revision 90976) |
+++ ppapi/proxy/ppb_instance_proxy.cc (working copy) |
@@ -111,6 +111,10 @@ |
OnMsgSetFullscreen) |
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetScreenSize, |
OnMsgGetScreenSize) |
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_RequestInputEvents, |
+ OnMsgRequestInputEvents) |
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ClearInputEvents, |
+ OnMsgClearInputEvents) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |
@@ -193,6 +197,35 @@ |
return result; |
} |
+int32_t PPB_Instance_Proxy::RequestInputEvents(PP_Instance instance, |
+ uint32_t event_classes) { |
+ dispatcher()->Send(new PpapiHostMsg_PPBInstance_RequestInputEvents( |
+ INTERFACE_ID_PPB_INSTANCE, instance, false, event_classes)); |
+ |
+ // We always register for the classes we can handle, this function validates |
+ // the flags so we can notify it if anything was invalid, withougt requiring |
dmichael (off chromium)
2011/07/01 20:04:19
withougt->without
|
+ // a sync reply. |
+ return ValidateRequestInputEvents(false, event_classes); |
+} |
+ |
+int32_t PPB_Instance_Proxy::RequestFilteringInputEvents( |
+ PP_Instance instance, |
+ uint32_t event_classes) { |
+ dispatcher()->Send(new PpapiHostMsg_PPBInstance_RequestInputEvents( |
+ INTERFACE_ID_PPB_INSTANCE, instance, true, event_classes)); |
+ |
+ // We always register for the classes we can handle, this function validates |
+ // the flags so we can notify it if anything was invalid, withougt requiring |
dmichael (off chromium)
2011/07/01 20:04:19
withougt->without
|
+ // a sync reply. |
+ return ValidateRequestInputEvents(true, event_classes); |
+} |
+ |
+void PPB_Instance_Proxy::ClearInputEventRequest(PP_Instance instance, |
+ uint32_t event_classes) { |
+ dispatcher()->Send(new PpapiHostMsg_PPBInstance_ClearInputEvents( |
+ INTERFACE_ID_PPB_INSTANCE, instance, event_classes)); |
dmichael (off chromium)
2011/07/01 20:04:19
Because this message is asynchronous & the proxy d
brettw
2011/07/01 21:14:52
Making this message sync doesn't help because ther
|
+} |
+ |
void PPB_Instance_Proxy::OnMsgGetWindowObject( |
PP_Instance instance, |
SerializedVarReturnValue result) { |
@@ -264,5 +297,24 @@ |
*result = enter.functions()->GetScreenSize(instance, size); |
} |
+void PPB_Instance_Proxy::OnMsgRequestInputEvents(PP_Instance instance, |
+ bool is_filtering, |
+ uint32_t event_classes) { |
+ EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); |
+ if (enter.succeeded()) { |
+ if (is_filtering) |
+ enter.functions()->RequestFilteringInputEvents(instance, event_classes); |
+ else |
+ enter.functions()->RequestInputEvents(instance, event_classes); |
+ } |
+} |
+ |
+void PPB_Instance_Proxy::OnMsgClearInputEvents(PP_Instance instance, |
+ uint32_t event_classes) { |
+ EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); |
+ if (enter.succeeded()) |
+ enter.functions()->ClearInputEventRequest(instance, event_classes); |
+} |
+ |
} // namespace proxy |
} // namespace pp |