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

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: Rebase 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 abc75b59ce7f588b603d2148bcba957cfc304eec..0b2b5e5802758d28a091c27400ed1c0a9a5874d4 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,20 @@ 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 rect between the two selection bounds augmented by bounding
+ // rects of any visible selection handles.
+ gfx::RectF GetRectBetweenBoundsIncludingHandles() 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 +122,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;

Powered by Google App Engine
This is Rietveld 408576698