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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 base::TimeDelta GetTapTimeout() const override; | 122 base::TimeDelta GetTapTimeout() const override; |
123 float GetTapSlop() const override; | 123 float GetTapSlop() const override; |
124 | 124 |
125 void ShowInsertionHandleAutomatically(); | 125 void ShowInsertionHandleAutomatically(); |
126 void ShowSelectionHandlesAutomatically(); | 126 void ShowSelectionHandlesAutomatically(); |
127 bool WillHandleTapOrLongPress(const gfx::PointF& location); | 127 bool WillHandleTapOrLongPress(const gfx::PointF& location); |
128 | 128 |
129 void OnInsertionChanged(); | 129 void OnInsertionChanged(); |
130 void OnSelectionChanged(); | 130 void OnSelectionChanged(); |
131 | 131 |
132 void ActivateInsertion(); | 132 // Returns true if insertion mode was newly (re)activated. |
| 133 bool ActivateInsertionIfNecessary(); |
133 void DeactivateInsertion(); | 134 void DeactivateInsertion(); |
134 void ActivateSelection(); | 135 // Returns true if selection mode was newly (re)activated. |
| 136 bool ActivateSelectionIfNecessary(); |
135 void DeactivateSelection(); | 137 void DeactivateSelection(); |
136 void ForceNextUpdateIfInactive(); | 138 void ForceNextUpdateIfInactive(); |
137 | 139 |
138 gfx::Vector2dF GetStartLineOffset() const; | 140 gfx::Vector2dF GetStartLineOffset() const; |
139 gfx::Vector2dF GetEndLineOffset() const; | 141 gfx::Vector2dF GetEndLineOffset() const; |
140 bool GetStartVisible() const; | 142 bool GetStartVisible() const; |
141 bool GetEndVisible() const; | 143 bool GetEndVisible() const; |
142 TouchHandle::AnimationStyle GetAnimationStyle(bool was_active) const; | 144 TouchHandle::AnimationStyle GetAnimationStyle(bool was_active) const; |
143 | 145 |
144 void LogSelectionEnd(); | 146 void LogSelectionEnd(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // Whether a selection handle was dragged during the current 'selection | 182 // Whether a selection handle was dragged during the current 'selection |
181 // session' - i.e. since the current selection has been activated. | 183 // session' - i.e. since the current selection has been activated. |
182 bool selection_handle_dragged_; | 184 bool selection_handle_dragged_; |
183 | 185 |
184 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); | 186 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); |
185 }; | 187 }; |
186 | 188 |
187 } // namespace ui | 189 } // namespace ui |
188 | 190 |
189 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 191 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
OLD | NEW |