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_TOUCH_HANDLE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_HANDLE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_HANDLE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_HANDLE_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class CONTENT_EXPORT TouchHandleClient { | 42 class CONTENT_EXPORT TouchHandleClient { |
43 public: | 43 public: |
44 virtual ~TouchHandleClient() {} | 44 virtual ~TouchHandleClient() {} |
45 virtual void OnHandleDragBegin(const TouchHandle& handle) = 0; | 45 virtual void OnHandleDragBegin(const TouchHandle& handle) = 0; |
46 virtual void OnHandleDragUpdate(const TouchHandle& handle, | 46 virtual void OnHandleDragUpdate(const TouchHandle& handle, |
47 const gfx::PointF& new_position) = 0; | 47 const gfx::PointF& new_position) = 0; |
48 virtual void OnHandleDragEnd(const TouchHandle& handle) = 0; | 48 virtual void OnHandleDragEnd(const TouchHandle& handle) = 0; |
49 virtual void OnHandleTapped(const TouchHandle& handle) = 0; | 49 virtual void OnHandleTapped(const TouchHandle& handle) = 0; |
50 virtual void SetNeedsAnimate() = 0; | 50 virtual void SetNeedsAnimate() = 0; |
51 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() = 0; | 51 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() = 0; |
| 52 virtual base::TimeDelta GetTapTimeout() const = 0; |
| 53 virtual float GetTapSlop() const = 0; |
52 }; | 54 }; |
53 | 55 |
54 // Responsible for displaying a selection or insertion handle for text | 56 // Responsible for displaying a selection or insertion handle for text |
55 // interaction. | 57 // interaction. |
56 class CONTENT_EXPORT TouchHandle { | 58 class CONTENT_EXPORT TouchHandle { |
57 public: | 59 public: |
58 // The drawable will be enabled but invisible until otherwise specified. | 60 // The drawable will be enabled but invisible until otherwise specified. |
59 TouchHandle(TouchHandleClient* client, TouchHandleOrientation orientation); | 61 TouchHandle(TouchHandleClient* client, TouchHandleOrientation orientation); |
60 ~TouchHandle(); | 62 ~TouchHandle(); |
61 | 63 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // may not reflect the actual visibilty and position of the drawable. This | 118 // may not reflect the actual visibilty and position of the drawable. This |
117 // discrepancy is resolved either upon fade completion or cancellation. | 119 // discrepancy is resolved either upon fade completion or cancellation. |
118 base::TimeTicks fade_end_time_; | 120 base::TimeTicks fade_end_time_; |
119 gfx::PointF fade_start_position_; | 121 gfx::PointF fade_start_position_; |
120 float alpha_; | 122 float alpha_; |
121 bool animate_deferred_fade_; | 123 bool animate_deferred_fade_; |
122 | 124 |
123 bool enabled_; | 125 bool enabled_; |
124 bool is_visible_; | 126 bool is_visible_; |
125 bool is_dragging_; | 127 bool is_dragging_; |
| 128 bool is_drag_within_tap_region_; |
126 | 129 |
127 DISALLOW_COPY_AND_ASSIGN(TouchHandle); | 130 DISALLOW_COPY_AND_ASSIGN(TouchHandle); |
128 }; | 131 }; |
129 | 132 |
130 } // namespace content | 133 } // namespace content |
131 | 134 |
132 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_HANDLE_H_ | 135 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_HANDLE_H_ |
OLD | NEW |