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

Unified Diff: ui/touch_selection/touch_selection_controller.h

Issue 1066053002: [Android] Allow custom ActionMode creation via ContentViewClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix null check 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
« 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 abc75b59ce7f588b603d2148bcba957cfc304eec..115dd0d637046b44aa49c42e832fc5e82489cc95 100644
--- a/ui/touch_selection/touch_selection_controller.h
+++ b/ui/touch_selection/touch_selection_controller.h
@@ -28,8 +28,7 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionControllerClient {
virtual void MoveRangeSelectionExtent(const gfx::PointF& extent) = 0;
virtual void SelectBetweenCoordinates(const gfx::PointF& base,
const gfx::PointF& extent) = 0;
- virtual void OnSelectionEvent(SelectionEventType event,
- const gfx::PointF& position) = 0;
+ virtual void OnSelectionEvent(SelectionEventType event) = 0;
virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() = 0;
};
@@ -83,6 +82,21 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController
// Returns true if an animation is active and requires further ticking.
bool Animate(base::TimeTicks animate_time);
+ // Returns the rect between the two active selection bounds. If just one of
+ // the bounds is visible, the rect is simply the (one-dimensional) rect of
+ // that bound. If no selection is active, an empty rect will be returned.
+ gfx::RectF GetRectBetweenBounds() const;
+
+ // Returns the visible rect of specified touch handle. For an active insertion
+ // these values will be identical.
+ gfx::RectF GetStartHandleRect() const;
+ gfx::RectF GetEndHandleRect() const;
+
+ // Returns the focal point of the start and end bounds, as defined by
+ // their bottom coordinate.
+ const gfx::PointF& GetStartPosition() const;
+ const gfx::PointF& GetEndPosition() const;
+
private:
enum InputEventType { TAP, LONG_PRESS, INPUT_EVENT_TYPE_NONE };
@@ -109,8 +123,6 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController
void DeactivateSelection();
void ResetCachedValuesIfInactive();
- const gfx::PointF& GetStartPosition() const;
- const gfx::PointF& GetEndPosition() const;
gfx::Vector2dF GetStartLineOffset() const;
gfx::Vector2dF GetEndLineOffset() const;
bool GetStartVisible() const;
« 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