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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // Interface with which the StylusTextSelector conveys drag and tap gestures | 24 // Interface with which the StylusTextSelector conveys drag and tap gestures |
25 // when the activating button is pressed. | 25 // when the activating button is pressed. |
26 // selection handles, or long press. | 26 // selection handles, or long press. |
27 class CONTENT_EXPORT StylusTextSelectorClient { | 27 class CONTENT_EXPORT StylusTextSelectorClient { |
28 public: | 28 public: |
29 virtual ~StylusTextSelectorClient() {} | 29 virtual ~StylusTextSelectorClient() {} |
30 | 30 |
31 // (x0, y0) and (x1, y1) indicate the bounds of the initial selection. | 31 // (x0, y0) and (x1, y1) indicate the bounds of the initial selection. |
32 virtual void OnStylusSelectBegin(float x0, float y0, float x1, float y1) = 0; | 32 virtual void OnStylusSelectBegin(float x0, float y0, float x1, float y1) = 0; |
33 virtual void OnStylusSelectUpdate(float x, float y) = 0; | 33 virtual void OnStylusSelectUpdate(float x, float y) = 0; |
34 virtual void OnStylusSelectEnd() = 0; | 34 virtual void OnStylusSelectEnd(float x, float y) = 0; |
35 virtual void OnStylusSelectTap(base::TimeTicks time, float x, float y) = 0; | 35 virtual void OnStylusSelectTap(base::TimeTicks time, float x, float y) = 0; |
36 }; | 36 }; |
37 | 37 |
38 // Provides stylus-based text selection and interaction, including: | 38 // Provides stylus-based text selection and interaction, including: |
39 // * Selection manipulation when an activating stylus button is pressed and | 39 // * Selection manipulation when an activating stylus button is pressed and |
40 // the stylus is dragged. | 40 // the stylus is dragged. |
41 // * Word selection and context menu activation when the when an activating | 41 // * Word selection and context menu activation when the when an activating |
42 // stylus button is pressed and the stylus is tapped. | 42 // stylus button is pressed and the stylus is tapped. |
43 class CONTENT_EXPORT StylusTextSelector : public ui::SimpleGestureListener { | 43 class CONTENT_EXPORT StylusTextSelector : public ui::SimpleGestureListener { |
44 public: | 44 public: |
(...skipping 30 matching lines...) Expand all Loading... |
75 float anchor_x_; | 75 float anchor_x_; |
76 float anchor_y_; | 76 float anchor_y_; |
77 std::unique_ptr<ui::GestureDetector> gesture_detector_; | 77 std::unique_ptr<ui::GestureDetector> gesture_detector_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(StylusTextSelector); | 79 DISALLOW_COPY_AND_ASSIGN(StylusTextSelector); |
80 }; | 80 }; |
81 | 81 |
82 } // namespace content | 82 } // namespace content |
83 | 83 |
84 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_STYLUS_TEXT_SELECTOR_H_ | 84 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_STYLUS_TEXT_SELECTOR_H_ |
OLD | NEW |