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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "ui/gfx/geometry/point_f.h" | 10 #include "ui/gfx/geometry/point_f.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Defaults to 8 DIPs. | 57 // Defaults to 8 DIPs. |
58 float tap_slop; | 58 float tap_slop; |
59 | 59 |
60 // Controls whether adaptive orientation for selection handles is enabled. | 60 // Controls whether adaptive orientation for selection handles is enabled. |
61 // Defaults to false. | 61 // Defaults to false. |
62 bool enable_adaptive_handle_orientation; | 62 bool enable_adaptive_handle_orientation; |
63 | 63 |
64 // Controls whether drag selection after a longpress is enabled. | 64 // Controls whether drag selection after a longpress is enabled. |
65 // Defaults to false. | 65 // Defaults to false. |
66 bool enable_longpress_drag_selection; | 66 bool enable_longpress_drag_selection; |
67 | |
68 // Controls whether an insertion handle is shown on a tap for an empty | |
69 // editable text. Defauls to false. | |
70 // TODO(mohsen): This flag used to be set to |true| on Aura. That's not the | |
71 // case anymore and it is always |false|. Consider removing it. | |
72 bool show_on_tap_for_empty_editable; | |
73 }; | 67 }; |
74 | 68 |
75 TouchSelectionController(TouchSelectionControllerClient* client, | 69 TouchSelectionController(TouchSelectionControllerClient* client, |
76 const Config& config); | 70 const Config& config); |
77 ~TouchSelectionController() override; | 71 ~TouchSelectionController() override; |
78 | 72 |
79 // To be called when the selection bounds have changed. | 73 // To be called when the selection bounds have changed. |
80 // Note that such updates will trigger handle updates only if preceded | 74 // Note that such updates will trigger handle updates only if preceded |
81 // by an appropriate call to allow automatic showing. | 75 // by an appropriate call to allow automatic showing. |
82 void OnSelectionBoundsChanged(const gfx::SelectionBound& start, | 76 void OnSelectionBoundsChanged(const gfx::SelectionBound& start, |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // Whether a selection handle was dragged during the current 'selection | 239 // Whether a selection handle was dragged during the current 'selection |
246 // session' - i.e. since the current selection has been activated. | 240 // session' - i.e. since the current selection has been activated. |
247 bool selection_handle_dragged_; | 241 bool selection_handle_dragged_; |
248 | 242 |
249 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); | 243 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); |
250 }; | 244 }; |
251 | 245 |
252 } // namespace ui | 246 } // namespace ui |
253 | 247 |
254 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 248 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
OLD | NEW |