OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_EXO_POINTER_DELEGATE_H_ | 5 #ifndef COMPONENTS_EXO_POINTER_DELEGATE_H_ |
6 #define COMPONENTS_EXO_POINTER_DELEGATE_H_ | 6 #define COMPONENTS_EXO_POINTER_DELEGATE_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "ui/events/event_constants.h" | 9 #include "ui/events/event_constants.h" |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 // is the location of pointer relative to the origin of surface and | 33 // is the location of pointer relative to the origin of surface and |
34 // |button_flags| contains all currently pressed buttons. | 34 // |button_flags| contains all currently pressed buttons. |
35 virtual void OnPointerEnter(Surface* surface, | 35 virtual void OnPointerEnter(Surface* surface, |
36 const gfx::PointF& location, | 36 const gfx::PointF& location, |
37 int pressed_button_flags) = 0; | 37 int pressed_button_flags) = 0; |
38 | 38 |
39 // Called when pointer leaves a valid target surface. | 39 // Called when pointer leaves a valid target surface. |
40 virtual void OnPointerLeave(Surface* surface) = 0; | 40 virtual void OnPointerLeave(Surface* surface) = 0; |
41 | 41 |
42 // Called when pointer moved within the current target surface. | 42 // Called when pointer moved within the current target surface. |
43 virtual void OnPointerMotion(base::TimeDelta time_stamp, | 43 virtual void OnPointerMotion(base::TimeTicks time_stamp, |
44 const gfx::PointF& location) = 0; | 44 const gfx::PointF& location) = 0; |
45 | 45 |
46 // Called when pointer button state changed. |changed_button_flags| contains | 46 // Called when pointer button state changed. |changed_button_flags| contains |
47 // all buttons that changed. |pressed| is true if buttons entered pressed | 47 // all buttons that changed. |pressed| is true if buttons entered pressed |
48 // state. | 48 // state. |
49 virtual void OnPointerButton(base::TimeDelta time_stamp, | 49 virtual void OnPointerButton(base::TimeTicks time_stamp, |
50 int changed_button_flags, | 50 int changed_button_flags, |
51 bool pressed) = 0; | 51 bool pressed) = 0; |
52 | 52 |
53 // Called when pointer is scrolling. |offset| contains the direction and | 53 // Called when pointer is scrolling. |offset| contains the direction and |
54 // distance of the change. |discrete| is true if the scrolling is caused | 54 // distance of the change. |discrete| is true if the scrolling is caused |
55 // by a discrete device such as a scroll wheel. | 55 // by a discrete device such as a scroll wheel. |
56 virtual void OnPointerScroll(base::TimeDelta time_stamp, | 56 virtual void OnPointerScroll(base::TimeTicks time_stamp, |
57 const gfx::Vector2dF& offset, | 57 const gfx::Vector2dF& offset, |
58 bool discrete) = 0; | 58 bool discrete) = 0; |
59 | 59 |
60 // Called when a current kinetic scroll should be canceled. | 60 // Called when a current kinetic scroll should be canceled. |
61 virtual void OnPointerScrollCancel(base::TimeDelta time_stamp) = 0; | 61 virtual void OnPointerScrollCancel(base::TimeTicks time_stamp) = 0; |
62 | 62 |
63 // Called when pointer scroll has stopped and a fling is happening (e.g. | 63 // Called when pointer scroll has stopped and a fling is happening (e.g. |
64 // lifting the fingers from the touchpad after scrolling quickly) | 64 // lifting the fingers from the touchpad after scrolling quickly) |
65 virtual void OnPointerScrollStop(base::TimeDelta time_stamp) = 0; | 65 virtual void OnPointerScrollStop(base::TimeTicks time_stamp) = 0; |
66 | 66 |
67 // Called after all pointer information of this frame has been set and the | 67 // Called after all pointer information of this frame has been set and the |
68 // client should evaluate the updated state. No events are being sent before | 68 // client should evaluate the updated state. No events are being sent before |
69 // this method is called. | 69 // this method is called. |
70 virtual void OnPointerFrame() = 0; | 70 virtual void OnPointerFrame() = 0; |
71 | 71 |
72 protected: | 72 protected: |
73 virtual ~PointerDelegate() {} | 73 virtual ~PointerDelegate() {} |
74 }; | 74 }; |
75 | 75 |
76 } // namespace exo | 76 } // namespace exo |
77 | 77 |
78 #endif // COMPONENTS_EXO_POINTER_DELEGATE_H_ | 78 #endif // COMPONENTS_EXO_POINTER_DELEGATE_H_ |
OLD | NEW |