OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_ |
7 | 7 |
| 8 #include "content/common/content_export.h" |
8 #include "third_party/WebKit/public/web/WebInputEvent.h" | 9 #include "third_party/WebKit/public/web/WebInputEvent.h" |
9 #include "ui/events/gesture_detection/motion_event.h" | 10 #include "ui/events/gesture_detection/motion_event.h" |
10 | 11 |
11 namespace content { | 12 namespace content { |
12 | 13 |
13 // Implementation of ui::MotionEvent wrapping a WebTouchEvent. | 14 // Implementation of ui::MotionEvent wrapping a WebTouchEvent. |
14 class MotionEventWeb : public ui::MotionEvent { | 15 class CONTENT_EXPORT MotionEventWeb : public ui::MotionEvent { |
15 public: | 16 public: |
16 explicit MotionEventWeb(const blink::WebTouchEvent& event); | 17 explicit MotionEventWeb(const blink::WebTouchEvent& event); |
17 ~MotionEventWeb() override; | 18 ~MotionEventWeb() override; |
18 | 19 |
19 // ui::MotionEvent | 20 // ui::MotionEvent |
20 uint32 GetUniqueEventId() const override; | 21 uint32 GetUniqueEventId() const override; |
21 Action GetAction() const override; | 22 Action GetAction() const override; |
22 int GetActionIndex() const override; | 23 int GetActionIndex() const override; |
23 size_t GetPointerCount() const override; | 24 size_t GetPointerCount() const override; |
24 int GetPointerId(size_t pointer_index) const override; | 25 int GetPointerId(size_t pointer_index) const override; |
25 float GetX(size_t pointer_index) const override; | 26 float GetX(size_t pointer_index) const override; |
26 float GetY(size_t pointer_index) const override; | 27 float GetY(size_t pointer_index) const override; |
27 float GetRawX(size_t pointer_index) const override; | 28 float GetRawX(size_t pointer_index) const override; |
28 float GetRawY(size_t pointer_index) const override; | 29 float GetRawY(size_t pointer_index) const override; |
29 float GetTouchMajor(size_t pointer_index) const override; | 30 float GetTouchMajor(size_t pointer_index) const override; |
30 float GetTouchMinor(size_t pointer_index) const override; | 31 float GetTouchMinor(size_t pointer_index) const override; |
31 float GetOrientation(size_t pointer_index) const override; | 32 float GetOrientation(size_t pointer_index) const override; |
32 float GetPressure(size_t pointer_index) const override; | 33 float GetPressure(size_t pointer_index) const override; |
| 34 float GetTilt(size_t pointer_index) const override; |
33 base::TimeTicks GetEventTime() const override; | 35 base::TimeTicks GetEventTime() const override; |
34 ToolType GetToolType(size_t pointer_index) const override; | 36 ToolType GetToolType(size_t pointer_index) const override; |
35 int GetButtonState() const override; | 37 int GetButtonState() const override; |
36 int GetFlags() const override; | 38 int GetFlags() const override; |
37 | 39 |
38 private: | 40 private: |
39 blink::WebTouchEvent event_; | 41 blink::WebTouchEvent event_; |
40 Action cached_action_; | 42 Action cached_action_; |
41 int cached_action_index_; | 43 int cached_action_index_; |
42 const uint32 unique_event_id_; | 44 const uint32 unique_event_id_; |
43 | 45 |
44 DISALLOW_COPY_AND_ASSIGN(MotionEventWeb); | 46 DISALLOW_COPY_AND_ASSIGN(MotionEventWeb); |
45 }; | 47 }; |
46 | 48 |
47 } // namespace content | 49 } // namespace content |
48 | 50 |
49 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_ | 51 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_WEB_H_ |
OLD | NEW |