OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ | 5 #ifndef VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ |
6 #define VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ | 6 #define VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/gfx/point.h" | 9 #include "ui/gfx/point.h" |
10 #include "views/touchui/touch_selection_controller.h" | 10 #include "views/touchui/touch_selection_controller.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 virtual ~TouchSelectionControllerImpl(); | 22 virtual ~TouchSelectionControllerImpl(); |
23 | 23 |
24 // TextSelectionController. | 24 // TextSelectionController. |
25 virtual void SelectionChanged(const gfx::Point& p1, | 25 virtual void SelectionChanged(const gfx::Point& p1, |
26 const gfx::Point& p2) OVERRIDE; | 26 const gfx::Point& p2) OVERRIDE; |
27 | 27 |
28 virtual void ClientViewLostFocus() OVERRIDE; | 28 virtual void ClientViewLostFocus() OVERRIDE; |
29 | 29 |
30 private: | 30 private: |
| 31 friend class TouchSelectionControllerImplTest; |
31 class SelectionHandleView; | 32 class SelectionHandleView; |
32 | 33 |
33 // Callback to inform the client view that the selection handle has been | 34 // Callback to inform the client view that the selection handle has been |
34 // dragged, hence selection may need to be updated. | 35 // dragged, hence selection may need to be updated. |
35 void SelectionHandleDragged(const gfx::Point& drag_pos); | 36 void SelectionHandleDragged(const gfx::Point& drag_pos); |
36 | 37 |
37 // Convenience method to convert a point from a selection handle's coordinate | 38 // Convenience method to convert a point from a selection handle's coordinate |
38 // system to that of the client view. | 39 // system to that of the client view. |
39 void ConvertPointToClientView(SelectionHandleView* source, gfx::Point* point); | 40 void ConvertPointToClientView(SelectionHandleView* source, gfx::Point* point); |
40 | 41 |
| 42 // Convenience methods for testing. |
| 43 gfx::Point GetSelectionHandle1Position(); |
| 44 gfx::Point GetSelectionHandle2Position(); |
| 45 bool IsSelectionHandle1Visible(); |
| 46 bool IsSelectionHandle2Visible(); |
| 47 |
41 TouchSelectionClientView* client_view_; | 48 TouchSelectionClientView* client_view_; |
42 scoped_ptr<SelectionHandleView> selection_handle_1_; | 49 scoped_ptr<SelectionHandleView> selection_handle_1_; |
43 scoped_ptr<SelectionHandleView> selection_handle_2_; | 50 scoped_ptr<SelectionHandleView> selection_handle_2_; |
44 | 51 |
45 // Pointer to the SelectionHandleView being dragged during a drag session. | 52 // Pointer to the SelectionHandleView being dragged during a drag session. |
46 SelectionHandleView* dragging_handle_; | 53 SelectionHandleView* dragging_handle_; |
47 | 54 |
48 DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerImpl); | 55 DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerImpl); |
49 }; | 56 }; |
50 | 57 |
51 } // namespace views | 58 } // namespace views |
52 | 59 |
53 #endif // VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ | 60 #endif // VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ |
OLD | NEW |