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 21 matching lines...) Expand all Loading... |
32 class SelectionHandleView; | 32 class SelectionHandleView; |
33 | 33 |
34 // 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 |
35 // dragged, hence selection may need to be updated. | 35 // dragged, hence selection may need to be updated. |
36 void SelectionHandleDragged(const gfx::Point& drag_pos); | 36 void SelectionHandleDragged(const gfx::Point& drag_pos); |
37 | 37 |
38 // 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 |
39 // system to that of the client view. | 39 // system to that of the client view. |
40 void ConvertPointToClientView(SelectionHandleView* source, gfx::Point* point); | 40 void ConvertPointToClientView(SelectionHandleView* source, gfx::Point* point); |
41 | 41 |
| 42 // Convenience method to check if a point lies inside or on the boundary of |
| 43 // client_view_. |
| 44 bool isPointInClientView(const gfx::Point& p); |
| 45 |
42 // Convenience methods for testing. | 46 // Convenience methods for testing. |
43 gfx::Point GetSelectionHandle1Position(); | 47 gfx::Point GetSelectionHandle1Position(); |
44 gfx::Point GetSelectionHandle2Position(); | 48 gfx::Point GetSelectionHandle2Position(); |
45 bool IsSelectionHandle1Visible(); | 49 bool IsSelectionHandle1Visible(); |
46 bool IsSelectionHandle2Visible(); | 50 bool IsSelectionHandle2Visible(); |
47 | 51 |
48 TouchSelectionClientView* client_view_; | 52 TouchSelectionClientView* client_view_; |
49 scoped_ptr<SelectionHandleView> selection_handle_1_; | 53 scoped_ptr<SelectionHandleView> selection_handle_1_; |
50 scoped_ptr<SelectionHandleView> selection_handle_2_; | 54 scoped_ptr<SelectionHandleView> selection_handle_2_; |
51 | 55 |
52 // Pointer to the SelectionHandleView being dragged during a drag session. | 56 // Pointer to the SelectionHandleView being dragged during a drag session. |
53 SelectionHandleView* dragging_handle_; | 57 SelectionHandleView* dragging_handle_; |
54 | 58 |
55 DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerImpl); | 59 DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerImpl); |
56 }; | 60 }; |
57 | 61 |
58 } // namespace views | 62 } // namespace views |
59 | 63 |
60 #endif // VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ | 64 #endif // VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ |
OLD | NEW |