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

Side by Side 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: Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 root_layer_->SetIsDrawable(false); 770 root_layer_->SetIsDrawable(false);
771 } 771 }
772 772
773 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { 773 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) {
774 layer->RemoveFromParent(); 774 layer->RemoveFromParent();
775 775
776 if (!root_layer_->children().size()) 776 if (!root_layer_->children().size())
777 root_layer_->SetIsDrawable(true); 777 root_layer_->SetIsDrawable(true);
778 } 778 }
779 779
780 void ContentViewCoreImpl::MoveSelectionExtent(const gfx::PointF& position) {
781 if (!web_contents_)
782 return;
783
784 web_contents_->MoveSelectionExtent(gfx::Point(position.x(), position.y()));
785 }
786
780 void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& start, 787 void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& start,
781 const gfx::PointF& end) { 788 const gfx::PointF& end) {
782 if (!web_contents_) 789 if (!web_contents_)
783 return; 790 return;
784 791
785 gfx::Point start_point = gfx::Point(start.x(), start.y()); 792 gfx::Point start_point = gfx::Point(start.x(), start.y());
786 gfx::Point end_point = gfx::Point(end.x(), end.y()); 793 gfx::Point end_point = gfx::Point(end.x(), end.y());
787 if (start_point == end_point) 794 if (start_point == end_point)
788 return; 795 return;
789 796
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 reinterpret_cast<ui::WindowAndroid*>(window_android), 1345 reinterpret_cast<ui::WindowAndroid*>(window_android),
1339 retained_objects_set); 1346 retained_objects_set);
1340 return reinterpret_cast<intptr_t>(view); 1347 return reinterpret_cast<intptr_t>(view);
1341 } 1348 }
1342 1349
1343 bool RegisterContentViewCore(JNIEnv* env) { 1350 bool RegisterContentViewCore(JNIEnv* env) {
1344 return RegisterNativesImpl(env); 1351 return RegisterNativesImpl(env);
1345 } 1352 }
1346 1353
1347 } // namespace content 1354 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698