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

Unified Diff: content/browser/renderer_host/input/stylus_text_selector.h

Issue 2885243003: [Android] Introduce state machine in stylus text selection (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/stylus_text_selector.h
diff --git a/content/browser/renderer_host/input/stylus_text_selector.h b/content/browser/renderer_host/input/stylus_text_selector.h
index 05d2f1803822ae3f4dbe27fea06ab87b211e5977..a7cbb77ad4457593d023e2d890cf9dc0ce16aefe 100644
--- a/content/browser/renderer_host/input/stylus_text_selector.h
+++ b/content/browser/renderer_host/input/stylus_text_selector.h
@@ -50,6 +50,11 @@ class CONTENT_EXPORT StylusTextSelector : public ui::SimpleGestureListener {
bool OnTouchEvent(const ui::MotionEvent& event);
private:
+ enum DragState {
+ NO_DRAG,
+ DRAGGING_IN_PROGRESS,
aelias_OOO_until_Jul13 2017/05/17 20:54:24 How about renaming these as: NO_DRAG, DRAGGING_WI
AKVT 2017/05/18 10:12:19 Done. Now it's more clear for readability.
+ WAS_DRAGGED,
+ };
friend class StylusTextSelectorTest;
FRIEND_TEST_ALL_PREFIXES(StylusTextSelectorTest, ShouldStartTextSelection);
@@ -66,8 +71,7 @@ class CONTENT_EXPORT StylusTextSelector : public ui::SimpleGestureListener {
StylusTextSelectorClient* client_;
bool text_selection_triggered_;
bool secondary_button_pressed_;
- bool dragging_;
- bool dragged_;
+ DragState drag_state_;
float anchor_x_;
float anchor_y_;
std::unique_ptr<ui::GestureDetector> gesture_detector_;

Powered by Google App Engine
This is Rietveld 408576698