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

Unified Diff: ui/touch_selection/touch_selection_controller.h

Issue 698253004: Reland: Implement Aura side of unified touch text selection for contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test failures on Mac Created 5 years, 8 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: 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 115dd0d637046b44aa49c42e832fc5e82489cc95..b5879c10f322e9be1f0dd0c2314934fd164ba514 100644
--- a/ui/touch_selection/touch_selection_controller.h
+++ b/ui/touch_selection/touch_selection_controller.h
@@ -30,6 +30,8 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionControllerClient {
const gfx::PointF& extent) = 0;
virtual void OnSelectionEvent(SelectionEventType event) = 0;
virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() = 0;
+ virtual void OnScrollStarted() = 0;
+ virtual void OnScrollCompleted() = 0;
};
// Controller for manipulating text selection via touch input.
@@ -42,10 +44,11 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController
bool show_on_tap_for_empty_editable);
~TouchSelectionController() override;
- // To be called when the selection bounds have changed.
+ // 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.
- void OnSelectionBoundsChanged(const SelectionBound& start,
+ // Return value specifies if anything has been updated or not.
+ bool OnSelectionBoundsUpdated(const SelectionBound& start,
const SelectionBound& end);
// Allows touch-dragging of the handle.
@@ -78,6 +81,9 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController
// To be called when the contents of the focused region changes.
void OnSelectionEmpty(bool empty);
+ // To be called when native view moves around.
+ void OnNativeViewMoved();
+
// Ticks an active animation, as requested to the client by |SetNeedsAnimate|.
// Returns true if an animation is active and requires further ticking.
bool Animate(base::TimeTicks animate_time);
@@ -97,6 +103,12 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController
const gfx::PointF& GetStartPosition() const;
const gfx::PointF& GetEndPosition() const;
+ const SelectionBound& start() const { return start_; }
+ const SelectionBound& end() const { return end_; }
+
+ bool is_insertion_active() const { return is_insertion_active_; }
+ bool is_selection_active() const { return is_selection_active_; }
+
private:
enum InputEventType { TAP, LONG_PRESS, INPUT_EVENT_TYPE_NONE };

Powered by Google App Engine
This is Rietveld 408576698