| Index: ui/android/view_android.h
|
| diff --git a/ui/android/view_android.h b/ui/android/view_android.h
|
| index 1b219e8f840f813d8ad9d585e1b6caaccae2c4c5..7f013a967eeccf31e1e838c53d910e6f26022175 100644
|
| --- a/ui/android/view_android.h
|
| +++ b/ui/android/view_android.h
|
| @@ -18,6 +18,7 @@ class Layer;
|
| }
|
|
|
| namespace ui {
|
| +class DragEventAndroid;
|
| class EventForwarder;
|
| class MotionEventAndroid;
|
| class ViewClient;
|
| @@ -63,7 +64,8 @@ class UI_ANDROID_EXPORT ViewAndroid {
|
| };
|
|
|
| // Layout parameters used to set the view's position and size.
|
| - // Position is in parent's coordinate space.
|
| + // Position is in parent's coordinate space, and all the values
|
| + // are in CSS pixel.
|
| struct LayoutParams {
|
| static LayoutParams MatchParent() { return {true, 0, 0, 0, 0}; }
|
| static LayoutParams Normal(int x, int y, int width, int height) {
|
| @@ -158,25 +160,35 @@ class UI_ANDROID_EXPORT ViewAndroid {
|
| friend class EventForwarder;
|
| friend class ViewAndroidBoundsTest;
|
|
|
| - using ViewClientCallback =
|
| - const base::Callback<bool(ViewClient*, const MotionEventAndroid&)>;
|
| -
|
| + bool OnDragEvent(const DragEventAndroid& event);
|
| bool OnTouchEvent(const MotionEventAndroid& event, bool for_touch_handle);
|
| bool OnMouseEvent(const MotionEventAndroid& event);
|
| bool OnMouseWheelEvent(const MotionEventAndroid& event);
|
|
|
| void RemoveChild(ViewAndroid* child);
|
|
|
| - bool HitTest(ViewClientCallback send_to_client,
|
| - const MotionEventAndroid& event);
|
| + template <typename E>
|
| + using ViewClientCallback =
|
| + const base::Callback<bool(ViewClient*, const E&, const gfx::PointF&)>;
|
| +
|
| + template <typename E>
|
| + bool HitTest(ViewClientCallback<E> send_to_client,
|
| + const E& event,
|
| + const gfx::PointF& point);
|
|
|
| + static bool SendDragEventToClient(ViewClient* client,
|
| + const DragEventAndroid& event,
|
| + const gfx::PointF& point);
|
| static bool SendTouchEventToClient(bool for_touch_handle,
|
| ViewClient* client,
|
| - const MotionEventAndroid& event);
|
| + const MotionEventAndroid& event,
|
| + const gfx::PointF& point);
|
| static bool SendMouseEventToClient(ViewClient* client,
|
| - const MotionEventAndroid& event);
|
| + const MotionEventAndroid& event,
|
| + const gfx::PointF& point);
|
| static bool SendMouseWheelEventToClient(ViewClient* client,
|
| - const MotionEventAndroid& event);
|
| + const MotionEventAndroid& event,
|
| + const gfx::PointF& point);
|
|
|
| bool has_event_forwarder() const { return !!event_forwarder_; }
|
|
|
|
|