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_SELECTION_CONTROLLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_H_ |
7 | 7 |
8 #include "cc/output/viewport_selection_bound.h" | 8 #include "cc/output/viewport_selection_bound.h" |
9 #include "content/browser/renderer_host/input/selection_event_type.h" | 9 #include "content/browser/renderer_host/input/selection_event_type.h" |
10 #include "content/browser/renderer_host/input/touch_handle.h" | 10 #include "content/browser/renderer_host/input/touch_handle.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // Interface through which |TouchSelectionController| issues selection-related | 25 // Interface through which |TouchSelectionController| issues selection-related |
26 // commands, notifications and requests. | 26 // commands, notifications and requests. |
27 class CONTENT_EXPORT TouchSelectionControllerClient { | 27 class CONTENT_EXPORT TouchSelectionControllerClient { |
28 public: | 28 public: |
29 virtual ~TouchSelectionControllerClient() {} | 29 virtual ~TouchSelectionControllerClient() {} |
30 | 30 |
31 virtual bool SupportsAnimation() const = 0; | 31 virtual bool SupportsAnimation() const = 0; |
32 virtual void SetNeedsAnimate() = 0; | 32 virtual void SetNeedsAnimate() = 0; |
33 virtual void MoveCaret(const gfx::PointF& position) = 0; | 33 virtual void MoveCaret(const gfx::PointF& position) = 0; |
34 virtual void SelectBetweenCoordinates(const gfx::PointF& start, | 34 virtual void MoveRangeSelectionExtent(const gfx::PointF& extent) = 0; |
35 const gfx::PointF& end) = 0; | 35 virtual void SelectBetweenCoordinates(const gfx::PointF& base, |
| 36 const gfx::PointF& extent) = 0; |
36 virtual void OnSelectionEvent(SelectionEventType event, | 37 virtual void OnSelectionEvent(SelectionEventType event, |
37 const gfx::PointF& position) = 0; | 38 const gfx::PointF& position) = 0; |
38 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() = 0; | 39 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() = 0; |
39 }; | 40 }; |
40 | 41 |
41 // Controller for manipulating text selection via touch input. | 42 // Controller for manipulating text selection via touch input. |
42 class CONTENT_EXPORT TouchSelectionController : public TouchHandleClient { | 43 class CONTENT_EXPORT TouchSelectionController : public TouchHandleClient { |
43 public: | 44 public: |
44 TouchSelectionController(TouchSelectionControllerClient* client, | 45 TouchSelectionController(TouchSelectionControllerClient* client, |
45 base::TimeDelta tap_timeout, | 46 base::TimeDelta tap_timeout, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 cc::ViewportSelectionBound end_; | 127 cc::ViewportSelectionBound end_; |
127 TouchHandleOrientation start_orientation_; | 128 TouchHandleOrientation start_orientation_; |
128 TouchHandleOrientation end_orientation_; | 129 TouchHandleOrientation end_orientation_; |
129 | 130 |
130 scoped_ptr<TouchHandle> insertion_handle_; | 131 scoped_ptr<TouchHandle> insertion_handle_; |
131 bool is_insertion_active_; | 132 bool is_insertion_active_; |
132 bool activate_insertion_automatically_; | 133 bool activate_insertion_automatically_; |
133 | 134 |
134 scoped_ptr<TouchHandle> start_selection_handle_; | 135 scoped_ptr<TouchHandle> start_selection_handle_; |
135 scoped_ptr<TouchHandle> end_selection_handle_; | 136 scoped_ptr<TouchHandle> end_selection_handle_; |
136 gfx::PointF fixed_handle_position_; | |
137 bool is_selection_active_; | 137 bool is_selection_active_; |
138 bool activate_selection_automatically_; | 138 bool activate_selection_automatically_; |
139 | 139 |
140 bool selection_empty_; | 140 bool selection_empty_; |
141 bool selection_editable_; | 141 bool selection_editable_; |
142 | 142 |
143 bool temporarily_hidden_; | 143 bool temporarily_hidden_; |
144 | 144 |
145 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); | 145 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); |
146 }; | 146 }; |
147 | 147 |
148 } // namespace content | 148 } // namespace content |
149 | 149 |
150 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_H_ | 150 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_H_ |
OLD | NEW |