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" |
| 11 #include "content/browser/renderer_host/input/touch_handle_orientation.h" |
11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
12 #include "ui/events/gesture_detection/motion_event.h" | 13 #include "ui/events/gesture_detection/motion_event.h" |
13 #include "ui/gfx/geometry/point_f.h" | 14 #include "ui/gfx/geometry/point_f.h" |
14 #include "ui/gfx/geometry/rect_f.h" | 15 #include "ui/gfx/geometry/rect_f.h" |
15 #include "ui/gfx/geometry/vector2d_f.h" | 16 #include "ui/gfx/geometry/vector2d_f.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 class TouchHandle; | 20 class TouchHandle; |
20 | 21 |
21 enum TouchHandleOrientation { | |
22 TOUCH_HANDLE_LEFT, | |
23 TOUCH_HANDLE_CENTER, | |
24 TOUCH_HANDLE_RIGHT, | |
25 TOUCH_HANDLE_ORIENTATION_UNDEFINED, | |
26 }; | |
27 | |
28 // Interface through which |TouchHandle| delegates rendering-specific duties. | 22 // Interface through which |TouchHandle| delegates rendering-specific duties. |
29 class CONTENT_EXPORT TouchHandleDrawable { | 23 class CONTENT_EXPORT TouchHandleDrawable { |
30 public: | 24 public: |
31 virtual ~TouchHandleDrawable() {} | 25 virtual ~TouchHandleDrawable() {} |
32 virtual void SetEnabled(bool enabled) = 0; | 26 virtual void SetEnabled(bool enabled) = 0; |
33 virtual void SetOrientation(TouchHandleOrientation orientation) = 0; | 27 virtual void SetOrientation(TouchHandleOrientation orientation) = 0; |
34 virtual void SetAlpha(float alpha) = 0; | 28 virtual void SetAlpha(float alpha) = 0; |
35 virtual void SetFocus(const gfx::PointF& position) = 0; | 29 virtual void SetFocus(const gfx::PointF& position) = 0; |
36 virtual void SetVisible(bool visible) = 0; | 30 virtual void SetVisible(bool visible) = 0; |
37 virtual bool IntersectsWith(const gfx::RectF& rect) const = 0; | 31 virtual bool IntersectsWith(const gfx::RectF& rect) const = 0; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 bool is_visible_; | 120 bool is_visible_; |
127 bool is_dragging_; | 121 bool is_dragging_; |
128 bool is_drag_within_tap_region_; | 122 bool is_drag_within_tap_region_; |
129 | 123 |
130 DISALLOW_COPY_AND_ASSIGN(TouchHandle); | 124 DISALLOW_COPY_AND_ASSIGN(TouchHandle); |
131 }; | 125 }; |
132 | 126 |
133 } // namespace content | 127 } // namespace content |
134 | 128 |
135 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_HANDLE_H_ | 129 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_HANDLE_H_ |
OLD | NEW |