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

Unified Diff: ui/base/touch/selection_bound.cc

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/base/touch/selection_bound.h ('k') | ui/touch_selection/selection_event_type.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/touch/selection_bound.cc
diff --git a/ui/base/touch/selection_bound.cc b/ui/base/touch/selection_bound.cc
index bd5b3c9c6beef999d944e58c6892cd446db8dbff..6aa472c6043ae38c2fda712dcab6197449542fdf 100644
--- a/ui/base/touch/selection_bound.cc
+++ b/ui/base/touch/selection_bound.cc
@@ -65,4 +65,20 @@ gfx::Rect RectBetweenSelectionBounds(const SelectionBound& b1,
return gfx::Rect(top_left, gfx::Size(diff.x(), diff.y()));
}
+gfx::RectF RectFBetweenSelectionBounds(const SelectionBound& b1,
+ const SelectionBound& b2) {
+ gfx::PointF top_left(b1.edge_top());
+ top_left.SetToMin(b1.edge_bottom());
+ top_left.SetToMin(b2.edge_top());
+ top_left.SetToMin(b2.edge_bottom());
+
+ gfx::PointF bottom_right(b1.edge_top());
+ bottom_right.SetToMax(b1.edge_bottom());
+ bottom_right.SetToMax(b2.edge_top());
+ bottom_right.SetToMax(b2.edge_bottom());
+
+ gfx::Vector2dF diff = bottom_right - top_left;
+ return gfx::RectF(top_left, gfx::SizeF(diff.x(), diff.y()));
+}
+
} // namespace ui
« no previous file with comments | « ui/base/touch/selection_bound.h ('k') | ui/touch_selection/selection_event_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698