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

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: 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 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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 root_layer_->SetIsDrawable(false); 763 root_layer_->SetIsDrawable(false);
764 } 764 }
765 765
766 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { 766 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) {
767 layer->RemoveFromParent(); 767 layer->RemoveFromParent();
768 768
769 if (!root_layer_->children().size()) 769 if (!root_layer_->children().size())
770 root_layer_->SetIsDrawable(true); 770 root_layer_->SetIsDrawable(true);
771 } 771 }
772 772
773 void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& start, 773 void ContentViewCoreImpl::MoveRangeSelectionExtent(const gfx::PointF& extent) {
774 const gfx::PointF& end) {
775 if (!web_contents_) 774 if (!web_contents_)
776 return; 775 return;
777 776
778 gfx::Point start_point = gfx::Point(start.x(), start.y()); 777 web_contents_->MoveRangeSelectionExtent(gfx::Point(extent.x(), extent.y()));
779 gfx::Point end_point = gfx::Point(end.x(), end.y()); 778 }
780 if (start_point == end_point) 779
780 void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& base,
781 const gfx::PointF& extent) {
782 if (!web_contents_)
781 return; 783 return;
782 784
783 web_contents_->SelectRange(start_point, end_point); 785 gfx::Point base_point = gfx::Point(base.x(), base.y());
786 gfx::Point extent_point = gfx::Point(extent.x(), extent.y());
787 if (base_point == extent_point)
788 return;
789
790 web_contents_->SelectRange(base_point, extent_point);
784 } 791 }
785 792
786 ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const { 793 ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const {
787 return view_android_; 794 return view_android_;
788 } 795 }
789 796
790 ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const { 797 ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const {
791 return window_android_; 798 return window_android_;
792 } 799 }
793 800
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 reinterpret_cast<ui::WindowAndroid*>(window_android), 1325 reinterpret_cast<ui::WindowAndroid*>(window_android),
1319 retained_objects_set); 1326 retained_objects_set);
1320 return reinterpret_cast<intptr_t>(view); 1327 return reinterpret_cast<intptr_t>(view);
1321 } 1328 }
1322 1329
1323 bool RegisterContentViewCore(JNIEnv* env) { 1330 bool RegisterContentViewCore(JNIEnv* env) {
1324 return RegisterNativesImpl(env); 1331 return RegisterNativesImpl(env);
1325 } 1332 }
1326 1333
1327 } // namespace content 1334 } // namespace content
OLDNEW
« 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