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

Unified Diff: content/browser/renderer_host/input/touch_selection_controller_unittest.cc

Issue 494823002: Plumb selection edge points through the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 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/touch_selection_controller_unittest.cc
diff --git a/content/browser/renderer_host/input/touch_selection_controller_unittest.cc b/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
index cfbd48ee6ac79f83ca7ca8c61d89f4662bb6cf69..460ed20250f5e3982c8f1c24f6cf36e49f70cc9d 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
@@ -85,51 +85,35 @@ class TouchSelectionControllerTest : public testing::Test,
void SetDraggingEnabled(bool enabled) { dragging_enabled_ = enabled; }
void ClearSelection() {
- controller_->OnSelectionBoundsChanged(gfx::RectF(),
- TOUCH_HANDLE_ORIENTATION_UNDEFINED,
- false,
- gfx::RectF(),
- TOUCH_HANDLE_ORIENTATION_UNDEFINED,
- false);
+ controller_->OnSelectionBoundsChanged(cc::ViewportSelectionBound(),
+ cc::ViewportSelectionBound());
}
void ClearInsertion() { ClearSelection(); }
- void ChangeInsertion(const gfx::RectF& rect,
- TouchHandleOrientation orientation,
- bool visible) {
- controller_->OnSelectionBoundsChanged(
- rect, orientation, visible, rect, orientation, visible);
- }
-
void ChangeInsertion(const gfx::RectF& rect, bool visible) {
- ChangeInsertion(rect, TOUCH_HANDLE_CENTER, visible);
- }
-
- void ChangeSelection(const gfx::RectF& start_rect,
- TouchHandleOrientation start_orientation,
- bool start_visible,
- const gfx::RectF& end_rect,
- TouchHandleOrientation end_orientation,
- bool end_visible) {
- controller_->OnSelectionBoundsChanged(start_rect,
- start_orientation,
- start_visible,
- end_rect,
- end_orientation,
- end_visible);
+ cc::ViewportSelectionBound bound;
+ bound.type = cc::SELECTION_BOUND_CENTER;
+ bound.edge_top = rect.origin();
+ bound.edge_bottom = rect.bottom_left();
+ bound.visible = visible;
+ controller_->OnSelectionBoundsChanged(bound, bound);
}
void ChangeSelection(const gfx::RectF& start_rect,
bool start_visible,
const gfx::RectF& end_rect,
bool end_visible) {
- ChangeSelection(start_rect,
- TOUCH_HANDLE_LEFT,
- start_visible,
- end_rect,
- TOUCH_HANDLE_RIGHT,
- end_visible);
+ cc::ViewportSelectionBound start_bound, end_bound;
+ start_bound.type = cc::SELECTION_BOUND_LEFT;
+ end_bound.type = cc::SELECTION_BOUND_RIGHT;
+ start_bound.edge_top = start_rect.origin();
+ start_bound.edge_bottom = start_rect.bottom_left();
+ end_bound.edge_top = end_rect.origin();
+ end_bound.edge_bottom = end_rect.bottom_left();
+ start_bound.visible = start_visible;
+ end_bound.visible = end_visible;
+ controller_->OnSelectionBoundsChanged(start_bound, end_bound);
}
void Animate() {

Powered by Google App Engine
This is Rietveld 408576698