| 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_TOUCH_DELEGATE_H_ | 5 #ifndef COMPONENTS_EXO_TOUCH_DELEGATE_H_ |
| 6 #define COMPONENTS_EXO_TOUCH_DELEGATE_H_ | 6 #define COMPONENTS_EXO_TOUCH_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 | 9 |
| 10 namespace gfx { | 10 namespace gfx { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // This should return true if |surface| is a valid target for this touch | 25 // This should return true if |surface| is a valid target for this touch |
| 26 // device. E.g. the surface is owned by the same client as the touch device. | 26 // device. E.g. the surface is owned by the same client as the touch device. |
| 27 virtual bool CanAcceptTouchEventsForSurface(Surface* surface) const = 0; | 27 virtual bool CanAcceptTouchEventsForSurface(Surface* surface) const = 0; |
| 28 | 28 |
| 29 // Called when a new touch point has appeared on the surface. This touch | 29 // Called when a new touch point has appeared on the surface. This touch |
| 30 // point is assigned a unique ID. Future events from this touch point | 30 // point is assigned a unique ID. Future events from this touch point |
| 31 // reference this ID. |location| is the initial location of touch point | 31 // reference this ID. |location| is the initial location of touch point |
| 32 // relative to the origin of the surface. | 32 // relative to the origin of the surface. |
| 33 virtual void OnTouchDown(Surface* surface, | 33 virtual void OnTouchDown(Surface* surface, |
| 34 base::TimeDelta time_stamp, | 34 base::TimeTicks time_stamp, |
| 35 int id, | 35 int id, |
| 36 const gfx::Point& location) = 0; | 36 const gfx::Point& location) = 0; |
| 37 | 37 |
| 38 // Called when a touch point has disappeared. No further events will be sent | 38 // Called when a touch point has disappeared. No further events will be sent |
| 39 // for this touch point. | 39 // for this touch point. |
| 40 virtual void OnTouchUp(base::TimeDelta time_stamp, int id) = 0; | 40 virtual void OnTouchUp(base::TimeTicks time_stamp, int id) = 0; |
| 41 | 41 |
| 42 // Called when a touch point has changed coordinates. | 42 // Called when a touch point has changed coordinates. |
| 43 virtual void OnTouchMotion(base::TimeDelta time_stamp, | 43 virtual void OnTouchMotion(base::TimeTicks time_stamp, |
| 44 int id, | 44 int id, |
| 45 const gfx::Point& location) = 0; | 45 const gfx::Point& location) = 0; |
| 46 | 46 |
| 47 // Called when the touch session has been canceled. Touch cancellation | 47 // Called when the touch session has been canceled. Touch cancellation |
| 48 // applies to all touch points currently active. | 48 // applies to all touch points currently active. |
| 49 virtual void OnTouchCancel() = 0; | 49 virtual void OnTouchCancel() = 0; |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 virtual ~TouchDelegate() {} | 52 virtual ~TouchDelegate() {} |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace exo | 55 } // namespace exo |
| 56 | 56 |
| 57 #endif // COMPONENTS_EXO_TOUCH_DELEGATE_H_ | 57 #endif // COMPONENTS_EXO_TOUCH_DELEGATE_H_ |
| OLD | NEW |