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 CONTENT_BROWSER_RENDERER_HOST_INPUT_STYLUS_TEXT_SELECTOR_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_STYLUS_TEXT_SELECTOR_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_STYLUS_TEXT_SELECTOR_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_STYLUS_TEXT_SELECTOR_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 // This should be called before |event| is seen by the platform gesture | 47 // This should be called before |event| is seen by the platform gesture |
48 // detector or forwarded to web content. | 48 // detector or forwarded to web content. |
49 bool OnTouchEvent(const ui::MotionEvent& event); | 49 bool OnTouchEvent(const ui::MotionEvent& event); |
50 | 50 |
51 private: | 51 private: |
52 friend class StylusTextSelectorTest; | 52 friend class StylusTextSelectorTest; |
53 FRIEND_TEST_ALL_PREFIXES(StylusTextSelectorTest, ShouldStartTextSelection); | 53 FRIEND_TEST_ALL_PREFIXES(StylusTextSelectorTest, ShouldStartTextSelection); |
54 | 54 |
55 // SimpleGestureListener implementation. | 55 // SimpleGestureListener implementation. |
56 bool OnSingleTapUp(const ui::MotionEvent& e) override; | 56 bool OnSingleTapUp(const ui::MotionEvent& e, int tap_count) override; |
57 bool OnScroll(const ui::MotionEvent& e1, | 57 bool OnScroll(const ui::MotionEvent& e1, |
58 const ui::MotionEvent& e2, | 58 const ui::MotionEvent& e2, |
59 float distance_x, | 59 float distance_x, |
60 float distance_y) override; | 60 float distance_y) override; |
61 | 61 |
62 static bool ShouldStartTextSelection(const ui::MotionEvent& event); | 62 static bool ShouldStartTextSelection(const ui::MotionEvent& event); |
63 | 63 |
64 StylusTextSelectorClient* client_; | 64 StylusTextSelectorClient* client_; |
65 bool text_selection_triggered_; | 65 bool text_selection_triggered_; |
66 bool secondary_button_pressed_; | 66 bool secondary_button_pressed_; |
67 bool dragging_; | 67 bool dragging_; |
68 bool dragged_; | 68 bool dragged_; |
69 float anchor_x_; | 69 float anchor_x_; |
70 float anchor_y_; | 70 float anchor_y_; |
71 scoped_ptr<ui::GestureDetector> gesture_detector_; | 71 scoped_ptr<ui::GestureDetector> gesture_detector_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(StylusTextSelector); | 73 DISALLOW_COPY_AND_ASSIGN(StylusTextSelector); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace content | 76 } // namespace content |
77 | 77 |
78 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_STYLUS_TEXT_SELECTOR_H_ | 78 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_STYLUS_TEXT_SELECTOR_H_ |
OLD | NEW |