| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_UI_VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ | 5 #ifndef UI_UI_VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ |
| 6 #define UI_UI_VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ | 6 #define UI_UI_VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/timer/timer.h" | 8 #include "base/timer/timer.h" |
| 9 #include "ui/aura/window_observer.h" | 9 #include "ui/aura/window_observer.h" |
| 10 #include "ui/base/touch/selection_bound.h" | 10 #include "ui/base/touch/selection_bound.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 gfx::Rect GetExpectedHandleBounds(const ui::SelectionBound& bound); | 113 gfx::Rect GetExpectedHandleBounds(const ui::SelectionBound& bound); |
| 114 views::WidgetDelegateView* GetHandle1View(); | 114 views::WidgetDelegateView* GetHandle1View(); |
| 115 views::WidgetDelegateView* GetHandle2View(); | 115 views::WidgetDelegateView* GetHandle2View(); |
| 116 | 116 |
| 117 ui::TouchEditable* client_view_; | 117 ui::TouchEditable* client_view_; |
| 118 Widget* client_widget_; | 118 Widget* client_widget_; |
| 119 scoped_ptr<EditingHandleView> selection_handle_1_; | 119 scoped_ptr<EditingHandleView> selection_handle_1_; |
| 120 scoped_ptr<EditingHandleView> selection_handle_2_; | 120 scoped_ptr<EditingHandleView> selection_handle_2_; |
| 121 scoped_ptr<EditingHandleView> cursor_handle_; | 121 scoped_ptr<EditingHandleView> cursor_handle_; |
| 122 TouchEditingMenuView* context_menu_; | 122 TouchEditingMenuView* context_menu_; |
| 123 bool command_executed_; |
| 124 base::TimeTicks selection_start_time_; |
| 123 | 125 |
| 124 // Timer to trigger |context_menu| (|context_menu| is not shown if the | 126 // Timer to trigger |context_menu| (|context_menu| is not shown if the |
| 125 // selection handles are being updated. It appears only when the handles are | 127 // selection handles are being updated. It appears only when the handles are |
| 126 // stationary for a certain amount of time). | 128 // stationary for a certain amount of time). |
| 127 base::OneShotTimer<TouchSelectionControllerImpl> context_menu_timer_; | 129 base::OneShotTimer<TouchSelectionControllerImpl> context_menu_timer_; |
| 128 | 130 |
| 129 // Pointer to the SelectionHandleView being dragged during a drag session. | 131 // Pointer to the SelectionHandleView being dragged during a drag session. |
| 130 EditingHandleView* dragging_handle_; | 132 EditingHandleView* dragging_handle_; |
| 131 | 133 |
| 132 // In cursor mode, the two selection bounds are the same and correspond to | 134 // In cursor mode, the two selection bounds are the same and correspond to |
| 133 // |cursor_handle_|; otherwise, they correspond to |selection_handle_1_| and | 135 // |cursor_handle_|; otherwise, they correspond to |selection_handle_1_| and |
| 134 // |selection_handle_2_|, respectively. These values should be used when | 136 // |selection_handle_2_|, respectively. These values should be used when |
| 135 // selection bounds needed rather than position of handles which might be | 137 // selection bounds needed rather than position of handles which might be |
| 136 // invalid when handles are hidden. | 138 // invalid when handles are hidden. |
| 137 ui::SelectionBound selection_bound_1_; | 139 ui::SelectionBound selection_bound_1_; |
| 138 ui::SelectionBound selection_bound_2_; | 140 ui::SelectionBound selection_bound_2_; |
| 139 | 141 |
| 140 // Selection bounds, clipped to client view's boundaries. | 142 // Selection bounds, clipped to client view's boundaries. |
| 141 ui::SelectionBound selection_bound_1_clipped_; | 143 ui::SelectionBound selection_bound_1_clipped_; |
| 142 ui::SelectionBound selection_bound_2_clipped_; | 144 ui::SelectionBound selection_bound_2_clipped_; |
| 143 | 145 |
| 144 DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerImpl); | 146 DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerImpl); |
| 145 }; | 147 }; |
| 146 | 148 |
| 147 } // namespace views | 149 } // namespace views |
| 148 | 150 |
| 149 #endif // UI_UI_VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ | 151 #endif // UI_UI_VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ |
| OLD | NEW |