Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: content/browser/renderer_host/input/stylus_text_selector.h

Issue 2201853002: Blink handle selection handle visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try running even rebaseline tests Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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;
aelias_OOO_until_Jul13 2016/10/07 02:40:20 Begin/End pairs are a common pattern and it's weir
amaralp 2016/10/14 00:53:07 Done.
35 virtual void OnStylusSelectTap(base::TimeTicks time, float x, float y) = 0; 34 virtual void OnStylusSelectTap(base::TimeTicks time, float x, float y) = 0;
36 }; 35 };
37 36
38 // Provides stylus-based text selection and interaction, including: 37 // Provides stylus-based text selection and interaction, including:
39 // * Selection manipulation when an activating stylus button is pressed and 38 // * Selection manipulation when an activating stylus button is pressed and
40 // the stylus is dragged. 39 // the stylus is dragged.
41 // * Word selection and context menu activation when the when an activating 40 // * Word selection and context menu activation when the when an activating
42 // stylus button is pressed and the stylus is tapped. 41 // stylus button is pressed and the stylus is tapped.
43 class CONTENT_EXPORT StylusTextSelector : public ui::SimpleGestureListener { 42 class CONTENT_EXPORT StylusTextSelector : public ui::SimpleGestureListener {
44 public: 43 public:
(...skipping 15 matching lines...) Expand all
60 const ui::MotionEvent& secondary_pointer_down, 59 const ui::MotionEvent& secondary_pointer_down,
61 float distance_x, 60 float distance_x,
62 float distance_y) override; 61 float distance_y) override;
63 62
64 static bool ShouldStartTextSelection(const ui::MotionEvent& event); 63 static bool ShouldStartTextSelection(const ui::MotionEvent& event);
65 64
66 StylusTextSelectorClient* client_; 65 StylusTextSelectorClient* client_;
67 bool text_selection_triggered_; 66 bool text_selection_triggered_;
68 bool secondary_button_pressed_; 67 bool secondary_button_pressed_;
69 bool dragging_; 68 bool dragging_;
70 bool dragged_;
aelias_OOO_until_Jul13 2016/10/07 02:40:20 Please move this cleanup to separate patch to keep
amaralp 2016/10/14 00:53:07 Done.
71 float anchor_x_; 69 float anchor_x_;
72 float anchor_y_; 70 float anchor_y_;
73 std::unique_ptr<ui::GestureDetector> gesture_detector_; 71 std::unique_ptr<ui::GestureDetector> gesture_detector_;
74 72
75 DISALLOW_COPY_AND_ASSIGN(StylusTextSelector); 73 DISALLOW_COPY_AND_ASSIGN(StylusTextSelector);
76 }; 74 };
77 75
78 } // namespace content 76 } // namespace content
79 77
80 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_STYLUS_TEXT_SELECTOR_H_ 78 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_STYLUS_TEXT_SELECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698