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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 657803002: Update touch selection to only modify one selection point at a time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 18528b6076aa5efeadeeec6e7d3e158862235093..9aa69cdf7daa3a7578068240ec0373366ffd46e7 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -770,17 +770,24 @@ void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) {
root_layer_->SetIsDrawable(true);
}
-void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& start,
- const gfx::PointF& end) {
+void ContentViewCoreImpl::MoveRangeSelectionExtent(const gfx::PointF& extent) {
if (!web_contents_)
return;
- gfx::Point start_point = gfx::Point(start.x(), start.y());
- gfx::Point end_point = gfx::Point(end.x(), end.y());
- if (start_point == end_point)
+ web_contents_->MoveRangeSelectionExtent(gfx::Point(extent.x(), extent.y()));
+}
+
+void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& base,
+ const gfx::PointF& extent) {
+ if (!web_contents_)
+ return;
+
+ gfx::Point base_point = gfx::Point(base.x(), base.y());
+ gfx::Point extent_point = gfx::Point(extent.x(), extent.y());
+ if (base_point == extent_point)
return;
- web_contents_->SelectRange(start_point, end_point);
+ web_contents_->SelectRange(base_point, extent_point);
}
ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const {
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/input/input_router_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698