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

Unified Diff: ui/touch_selection/touch_selection_controller.h

Issue 903143003: wip: Touch Text Selection Prototypes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@selection_granularity_on_unified
Patch Set: Created 5 years, 10 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
« no previous file with comments | « ui/touch_selection/touch_handle.cc ('k') | ui/touch_selection/touch_selection_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/touch_selection/touch_selection_controller.h
diff --git a/ui/touch_selection/touch_selection_controller.h b/ui/touch_selection/touch_selection_controller.h
index b18353b5287556d58fa447110cf54fb4e08c7d3a..69982875892382034e1829407b8ca3f637cffc1f 100644
--- a/ui/touch_selection/touch_selection_controller.h
+++ b/ui/touch_selection/touch_selection_controller.h
@@ -15,6 +15,7 @@
namespace ui {
class MotionEvent;
+class GranularityStrategy;
// Interface through which |TouchSelectionController| issues selection-related
// commands, notifications and requests.
@@ -39,12 +40,16 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionControllerClient {
class UI_TOUCH_SELECTION_EXPORT TouchSelectionController
: public TouchHandleClient {
public:
- TouchSelectionController(TouchSelectionControllerClient* client,
- base::TimeDelta tap_timeout,
- float tap_slop,
- bool show_on_tap_for_empty_editable);
+ TouchSelectionController(
+ TouchSelectionControllerClient* client,
+ base::TimeDelta tap_timeout,
+ float tap_slop,
+ bool show_on_tap_for_empty_editable,
+ TextSelectionGranularityStrategy selection_granularity_strategy);
~TouchSelectionController() override;
+ void SetVelocityStrategyParameters(int halfDecayMs, int threshold);
+
// To be called when the selection bounds info has been updated.
// Note that such updates will trigger handle updates only if preceded
// by an appropriate call to allow automatic showing.
@@ -99,9 +104,11 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController
enum InputEventType { TAP, LONG_PRESS, INPUT_EVENT_TYPE_NONE };
// TouchHandleClient implementation.
- void OnHandleDragBegin(const TouchHandle& handle) override;
+ void OnHandleDragBegin(const TouchHandle& handle,
+ base::TimeTicks event_time) override;
void OnHandleDragUpdate(const TouchHandle& handle,
- const gfx::PointF& new_position) override;
+ const gfx::PointF& new_position,
+ base::TimeTicks event_time) override;
void OnHandleDragEnd(const TouchHandle& handle) override;
void OnHandleTapped(const TouchHandle& handle) override;
void SetNeedsAnimate() override;
@@ -154,6 +161,7 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController
scoped_ptr<TouchHandle> start_selection_handle_;
scoped_ptr<TouchHandle> end_selection_handle_;
+
bool is_selection_active_;
bool activate_selection_automatically_;
@@ -162,6 +170,9 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController
bool temporarily_hidden_;
+ TextSelectionGranularityStrategy selection_granularity_strategy_;
+ scoped_ptr<GranularityStrategy> granularity_strategy_;
+
DISALLOW_COPY_AND_ASSIGN(TouchSelectionController);
};
« no previous file with comments | « ui/touch_selection/touch_handle.cc ('k') | ui/touch_selection/touch_selection_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698