1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_
8 #include "third_party/WebKit/public/web/WebInputEvent.h"
9 #include "ui/events/gesture_detection/motion_event.h"
13 // Implementation of ui::MotionEvent wrapping a WebTouchEvent.
14 class MotionEventWeb
: public ui::MotionEvent
{
16 explicit MotionEventWeb(const blink::WebTouchEvent
& event
);
17 virtual ~MotionEventWeb();
20 virtual int GetId() const OVERRIDE
;
21 virtual Action
GetAction() const OVERRIDE
;
22 virtual int GetActionIndex() const OVERRIDE
;
23 virtual size_t GetPointerCount() const OVERRIDE
;
24 virtual int GetPointerId(size_t pointer_index
) const OVERRIDE
;
25 virtual float GetX(size_t pointer_index
) const OVERRIDE
;
26 virtual float GetY(size_t pointer_index
) const OVERRIDE
;
27 virtual float GetRawX(size_t pointer_index
) const OVERRIDE
;
28 virtual float GetRawY(size_t pointer_index
) const OVERRIDE
;
29 virtual float GetTouchMajor(size_t pointer_index
) const OVERRIDE
;
30 virtual float GetPressure(size_t pointer_index
) const OVERRIDE
;
31 virtual base::TimeTicks
GetEventTime() const OVERRIDE
;
32 virtual ToolType
GetToolType(size_t pointer_index
) const OVERRIDE
;
33 virtual int GetButtonState() const OVERRIDE
;
34 virtual scoped_ptr
<MotionEvent
> Clone() const OVERRIDE
;
35 virtual scoped_ptr
<MotionEvent
> Cancel() const OVERRIDE
;
38 blink::WebTouchEvent event_
;
39 Action cached_action_
;
40 int cached_action_index_
;
42 DISALLOW_COPY_AND_ASSIGN(MotionEventWeb
);
45 } // namespace content
47 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_