| Index: ppapi/proxy/resource_creation_proxy.cc
|
| diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc
|
| index de5373548ef34f78e19163cc8cc2d034a43ebd7e..d915a81e37478a9214d3e01182fd4cda89a3baa2 100644
|
| --- a/ppapi/proxy/resource_creation_proxy.cc
|
| +++ b/ppapi/proxy/resource_creation_proxy.cc
|
| @@ -76,6 +76,21 @@ PP_Resource ResourceCreationProxy::CreateFileSystem(
|
| return PPB_FileSystem_Proxy::CreateProxyResource(instance, type);
|
| }
|
|
|
| +PP_Resource ResourceCreationProxy::CreateIMEInputEvent(
|
| + PP_Instance instance,
|
| + PP_InputEvent_Type type,
|
| + PP_TimeTicks time_stamp,
|
| + struct PP_Var text,
|
| + uint32_t segment_number,
|
| + const uint32_t* segment_offsets,
|
| + int32_t target_segment,
|
| + uint32_t selection_start,
|
| + uint32_t selection_end) {
|
| + return PPB_InputEvent_Shared::CreateIMEInputEvent(
|
| + OBJECT_IS_PROXY, instance, type, time_stamp, text, segment_number,
|
| + segment_offsets, target_segment, selection_start, selection_end);
|
| +}
|
| +
|
| PP_Resource ResourceCreationProxy::CreateKeyboardInputEvent(
|
| PP_Instance instance,
|
| PP_InputEvent_Type type,
|
| @@ -83,25 +98,9 @@ PP_Resource ResourceCreationProxy::CreateKeyboardInputEvent(
|
| uint32_t modifiers,
|
| uint32_t key_code,
|
| struct PP_Var character_text) {
|
| - if (type != PP_INPUTEVENT_TYPE_RAWKEYDOWN &&
|
| - type != PP_INPUTEVENT_TYPE_KEYDOWN &&
|
| - type != PP_INPUTEVENT_TYPE_KEYUP &&
|
| - type != PP_INPUTEVENT_TYPE_CHAR)
|
| - return 0;
|
| - InputEventData data;
|
| - data.event_type = type;
|
| - data.event_time_stamp = time_stamp;
|
| - data.event_modifiers = modifiers;
|
| - data.key_code = key_code;
|
| - if (character_text.type == PP_VARTYPE_STRING) {
|
| - StringVar* text_str = StringVar::FromPPVar(character_text);
|
| - if (!text_str)
|
| - return 0;
|
| - data.character_text = text_str->value();
|
| - }
|
| -
|
| - return (new PPB_InputEvent_Shared(OBJECT_IS_PROXY,
|
| - instance, data))->GetReference();
|
| + return PPB_InputEvent_Shared::CreateKeyboardInputEvent(
|
| + OBJECT_IS_PROXY, instance, type, time_stamp, modifiers, key_code,
|
| + character_text);
|
| }
|
|
|
| PP_Resource ResourceCreationProxy::CreateMouseInputEvent(
|
| @@ -113,24 +112,9 @@ PP_Resource ResourceCreationProxy::CreateMouseInputEvent(
|
| const PP_Point* mouse_position,
|
| int32_t click_count,
|
| const PP_Point* mouse_movement) {
|
| - if (type != PP_INPUTEVENT_TYPE_MOUSEDOWN &&
|
| - type != PP_INPUTEVENT_TYPE_MOUSEUP &&
|
| - type != PP_INPUTEVENT_TYPE_MOUSEMOVE &&
|
| - type != PP_INPUTEVENT_TYPE_MOUSEENTER &&
|
| - type != PP_INPUTEVENT_TYPE_MOUSELEAVE)
|
| - return 0;
|
| -
|
| - InputEventData data;
|
| - data.event_type = type;
|
| - data.event_time_stamp = time_stamp;
|
| - data.event_modifiers = modifiers;
|
| - data.mouse_button = mouse_button;
|
| - data.mouse_position = *mouse_position;
|
| - data.mouse_click_count = click_count;
|
| - data.mouse_movement = *mouse_movement;
|
| -
|
| - return (new PPB_InputEvent_Shared(OBJECT_IS_PROXY,
|
| - instance, data))->GetReference();
|
| + return PPB_InputEvent_Shared::CreateMouseInputEvent(
|
| + OBJECT_IS_PROXY, instance, type, time_stamp, modifiers,
|
| + mouse_button, mouse_position, click_count, mouse_movement);
|
| }
|
|
|
| PP_Resource ResourceCreationProxy::CreateResourceArray(
|
| @@ -160,16 +144,9 @@ PP_Resource ResourceCreationProxy::CreateWheelInputEvent(
|
| const PP_FloatPoint* wheel_delta,
|
| const PP_FloatPoint* wheel_ticks,
|
| PP_Bool scroll_by_page) {
|
| - InputEventData data;
|
| - data.event_type = PP_INPUTEVENT_TYPE_WHEEL;
|
| - data.event_time_stamp = time_stamp;
|
| - data.event_modifiers = modifiers;
|
| - data.wheel_delta = *wheel_delta;
|
| - data.wheel_ticks = *wheel_ticks;
|
| - data.wheel_scroll_by_page = PP_ToBool(scroll_by_page);
|
| -
|
| - return (new PPB_InputEvent_Shared(OBJECT_IS_PROXY,
|
| - instance, data))->GetReference();
|
| + return PPB_InputEvent_Shared::CreateWheelInputEvent(
|
| + OBJECT_IS_PROXY, instance, time_stamp, modifiers,
|
| + wheel_delta, wheel_ticks, scroll_by_page);
|
| }
|
|
|
| #if !defined(OS_NACL)
|
|
|