OnKeyUp, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MULTI_DOWN,
- OnMultiTouchEvent, this);
+ OnMultiTouchDownEvent, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MULTI_MOVE,
- OnMultiTouchEvent, this);
+ OnMultiTouchMoveEvent, this);
evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MULTI_UP,
- OnMultiTouchEvent, this);
+ OnMultiTouchUpEvent, this);
#if defined(OS_TIZEN_MOBILE)
eext_object_event_callback_add(content_image_, EEXT_CALLBACK_BACK,
OnKeyUp);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MULTI_DOWN,
- OnMultiTouchEvent);
+ OnMultiTouchDownEvent);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MULTI_MOVE,
- OnMultiTouchEvent);
+ OnMultiTouchMoveEvent);
evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MULTI_UP,
- OnMultiTouchEvent);
+ OnMultiTouchUpEvent);
evas_object_del(content_image_elm_host_);
content_image_elm_host_ = NULL;
static_cast<Evas_Event_Mouse_Down*>(event_info));
rwhv->host_->ForwardMouseEvent(event);
} else {
- rwhv->ProcessTouchEvents();
+ rwhv->ProcessTouchEvents(
+ static_cast<Evas_Event_Mouse_Down*>(event_info)->timestamp);
}
}
static_cast<Evas_Event_Mouse_Up*>(event_info));
rwhv->host_->ForwardMouseEvent(event);
} else {
- rwhv->ProcessTouchEvents();
+ rwhv->ProcessTouchEvents(
+ static_cast<Evas_Event_Mouse_Up*>(event_info)->timestamp);
}
}
static_cast<Evas_Event_Mouse_Move*>(event_info));
rwhv->host_->ForwardMouseEvent(event);
} else {
- rwhv->ProcessTouchEvents();
+ rwhv->ProcessTouchEvents(
+ static_cast<Evas_Event_Mouse_Move*>(event_info)->timestamp);
}
}
-void RenderWidgetHostViewEfl::OnMultiTouchEvent(
+void RenderWidgetHostViewEfl::OnMultiTouchDownEvent(
void* data, Evas* evas, Evas_Object* obj, void* event_info) {
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
CHECK(rwhv->touch_events_enabled_);
- rwhv->ProcessTouchEvents();
+ rwhv->ProcessTouchEvents(
+ static_cast<Evas_Event_Multi_Down*>(event_info)->timestamp);
+}
+
+void RenderWidgetHostViewEfl::OnMultiTouchMoveEvent(
+ void* data, Evas* evas, Evas_Object* obj, void* event_info) {
+ RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
+ CHECK(rwhv->touch_events_enabled_);
+ rwhv->ProcessTouchEvents(
+ static_cast<Evas_Event_Multi_Move*>(event_info)->timestamp);
+}
+
+void RenderWidgetHostViewEfl::OnMultiTouchUpEvent(
+ void* data, Evas* evas, Evas_Object* obj, void* event_info) {
+ RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
+ CHECK(rwhv->touch_events_enabled_);
+ rwhv->ProcessTouchEvents(
+ static_cast<Evas_Event_Multi_Up*>(event_info)->timestamp);
}
void RenderWidgetHostViewEfl::OnKeyDown(
}
}
-void RenderWidgetHostViewEfl::ProcessTouchEvents() {
+void RenderWidgetHostViewEfl::ProcessTouchEvents(unsigned int timestamp) {
// These constants are used to map multi touch's touch id(s).
// The poorly-written Tizen API document says:
// "0 for Mouse Event and device id for Multi Event."
}
}
- ui::TouchEvent touch_event = MakeTouchEvent(pt, state, id, content_image_);
+ ui::TouchEvent touch_event =
+ MakeTouchEvent(pt, state, id, content_image_, timestamp);
HandleTouchEvent(&touch_event);
}
}
static void OnMotionMove(void* data, Evas_Object*, void*);
static void OnMotionZoom(void* data, Evas_Object*, void*);
- static void OnMultiTouchEvent(void* data, Evas*, Evas_Object*, void*);
+ static void OnMultiTouchDownEvent(void* data, Evas*, Evas_Object*, void*);
+ static void OnMultiTouchMoveEvent(void* data, Evas*, Evas_Object*, void*);
+ static void OnMultiTouchUpEvent(void* data, Evas*, Evas_Object*, void*);
static void OnMouseDown(void* data, Evas*, Evas_Object*, void*);
static void OnMouseUp(void* data, Evas*, Evas_Object*, void*);
static void OnHWBackEvent(void*, Evas_Object*, void*);
#endif
- void ProcessTouchEvents();
+ void ProcessTouchEvents(unsigned int timestamp);
void SetDoubleTapSupportEnabled(bool enabled);
void OnOrientationChangeEvent(int);
#include "base/time/time.h"
#include "base/strings/utf_string_conversions.h"
+#include "ui/events/event_utils.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
#include "ui/gfx/screen.h"
}
ui::TouchEvent MakeTouchEvent(Evas_Coord_Point pt,
- Evas_Touch_Point_State state, int id, Evas_Object* view) {
+ Evas_Touch_Point_State state,
+ int id, Evas_Object* view,
+ unsigned int timestamp) {
TranslateEvasCoordToWebKitCoord(view, pt.x, pt.y);
const float scale = GetDeviceScaleFactor();
+ base::TimeDelta event_timestamp =
+ base::TimeDelta::FromMilliseconds(timestamp);
+ if (timestamp == 0)
+ event_timestamp = ui::EventTimeForNow();
return ui::TouchEvent(EvasTouchEventTypeToUI(state),
- gfx::Point(pt.x / scale, pt.y / scale),
- id, base::TimeDelta::FromMilliseconds(ecore_time_get() * 1000));
+ gfx::Point(pt.x / scale, pt.y / scale), id, event_timestamp);
}
}