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

Unified Diff: ui/views/touchui/touch_selection_controller_impl.cc

Issue 1417023002: Remove some implicit Point to PointF conversions, add helpers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-views: extrachange Created 5 years, 2 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/views/touchui/touch_selection_controller_impl.cc
diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc
index 55af1bc90ec371dac7624a8b5dac3d3782bc8067..d273ee3fa1913b6b5db4b4623447716d017e4fe1 100644
--- a/ui/views/touchui/touch_selection_controller_impl.cc
+++ b/ui/views/touchui/touch_selection_controller_impl.cc
@@ -182,7 +182,7 @@ ui::SelectionBound ConvertFromScreen(ui::TouchEditable* client,
gfx::Point edge_top = bound.edge_top_rounded();
client->ConvertPointFromScreen(&edge_bottom);
client->ConvertPointFromScreen(&edge_top);
- result.SetEdge(edge_top, edge_bottom);
+ result.SetEdge(gfx::PointF(edge_top), gfx::PointF(edge_bottom));
return result;
}
@@ -193,7 +193,7 @@ ui::SelectionBound ConvertToScreen(ui::TouchEditable* client,
gfx::Point edge_top = bound.edge_top_rounded();
client->ConvertPointToScreen(&edge_bottom);
client->ConvertPointToScreen(&edge_top);
- result.SetEdge(edge_top, edge_bottom);
+ result.SetEdge(gfx::PointF(edge_top), gfx::PointF(edge_bottom));
return result;
}
@@ -364,7 +364,7 @@ class TouchSelectionControllerImpl::EditingHandleView
gfx::Point edge_bottom = selection_bound_.edge_bottom_rounded();
wm::ConvertPointFromScreen(window, &edge_top);
wm::ConvertPointFromScreen(window, &edge_bottom);
- selection_bound_.SetEdge(edge_top, edge_bottom);
+ selection_bound_.SetEdge(gfx::PointF(edge_top), gfx::PointF(edge_bottom));
}
void SetDrawInvisible(bool draw_invisible) {
@@ -457,12 +457,12 @@ void TouchSelectionControllerImpl::SelectionChanged() {
ui::SelectionBound screen_bound_focus = ConvertToScreen(client_view_, focus);
gfx::Rect client_bounds = client_view_->GetBounds();
if (anchor.edge_top().y() < client_bounds.y()) {
- gfx::Point anchor_edge_top = anchor.edge_top_rounded();
+ auto anchor_edge_top = gfx::PointF(anchor.edge_top_rounded());
anchor_edge_top.set_y(client_bounds.y());
anchor.SetEdgeTop(anchor_edge_top);
}
if (focus.edge_top().y() < client_bounds.y()) {
- gfx::Point focus_edge_top = focus.edge_top_rounded();
+ auto focus_edge_top = gfx::PointF(focus.edge_top_rounded());
focus_edge_top.set_y(client_bounds.y());
focus.SetEdgeTop(focus_edge_top);
}

Powered by Google App Engine
This is Rietveld 408576698