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 UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 5 #ifndef UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
6 #define UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 6 #define UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
7 | 7 |
8 #include "ui/base/touch/selection_bound.h" | 8 #include "ui/base/touch/selection_bound.h" |
9 #include "ui/gfx/geometry/point_f.h" | 9 #include "ui/gfx/geometry/point_f.h" |
10 #include "ui/gfx/geometry/rect_f.h" | 10 #include "ui/gfx/geometry/rect_f.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void ResetCachedValuesIfInactive(); | 108 void ResetCachedValuesIfInactive(); |
109 | 109 |
110 const gfx::PointF& GetStartPosition() const; | 110 const gfx::PointF& GetStartPosition() const; |
111 const gfx::PointF& GetEndPosition() const; | 111 const gfx::PointF& GetEndPosition() const; |
112 gfx::Vector2dF GetStartLineOffset() const; | 112 gfx::Vector2dF GetStartLineOffset() const; |
113 gfx::Vector2dF GetEndLineOffset() const; | 113 gfx::Vector2dF GetEndLineOffset() const; |
114 bool GetStartVisible() const; | 114 bool GetStartVisible() const; |
115 bool GetEndVisible() const; | 115 bool GetEndVisible() const; |
116 TouchHandle::AnimationStyle GetAnimationStyle(bool was_active) const; | 116 TouchHandle::AnimationStyle GetAnimationStyle(bool was_active) const; |
117 | 117 |
| 118 void LogSelectionEnd(); |
| 119 |
118 TouchSelectionControllerClient* const client_; | 120 TouchSelectionControllerClient* const client_; |
119 const base::TimeDelta tap_timeout_; | 121 const base::TimeDelta tap_timeout_; |
120 const float tap_slop_; | 122 const float tap_slop_; |
121 | 123 |
122 InputEventType response_pending_input_event_; | 124 InputEventType response_pending_input_event_; |
123 | 125 |
124 SelectionBound start_; | 126 SelectionBound start_; |
125 SelectionBound end_; | 127 SelectionBound end_; |
126 TouchHandleOrientation start_orientation_; | 128 TouchHandleOrientation start_orientation_; |
127 TouchHandleOrientation end_orientation_; | 129 TouchHandleOrientation end_orientation_; |
128 | 130 |
129 scoped_ptr<TouchHandle> insertion_handle_; | 131 scoped_ptr<TouchHandle> insertion_handle_; |
130 bool is_insertion_active_; | 132 bool is_insertion_active_; |
131 bool activate_insertion_automatically_; | 133 bool activate_insertion_automatically_; |
132 | 134 |
133 scoped_ptr<TouchHandle> start_selection_handle_; | 135 scoped_ptr<TouchHandle> start_selection_handle_; |
134 scoped_ptr<TouchHandle> end_selection_handle_; | 136 scoped_ptr<TouchHandle> end_selection_handle_; |
135 bool is_selection_active_; | 137 bool is_selection_active_; |
136 bool activate_selection_automatically_; | 138 bool activate_selection_automatically_; |
137 | 139 |
138 bool selection_empty_; | 140 bool selection_empty_; |
139 bool selection_editable_; | 141 bool selection_editable_; |
140 | 142 |
141 bool temporarily_hidden_; | 143 bool temporarily_hidden_; |
142 | 144 |
| 145 base::TimeTicks selection_start_time_; |
| 146 // Whether a selection handle was dragged during the current 'selection |
| 147 // session' - i.e. since the current selection has been activated. |
| 148 bool selection_handle_dragged_; |
| 149 |
143 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); | 150 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); |
144 }; | 151 }; |
145 | 152 |
146 } // namespace ui | 153 } // namespace ui |
147 | 154 |
148 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 155 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
OLD | NEW |