Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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::SelectBetweenCoordinates(const gfx::PointF& start, | 780 void ContentViewCoreImpl::MoveRangeSelectionExtent(const gfx::PointF& extent) { |
| 781 const gfx::PointF& end) { | |
| 782 if (!web_contents_) | 781 if (!web_contents_) |
| 783 return; | 782 return; |
| 784 | 783 |
| 785 gfx::Point start_point = gfx::Point(start.x(), start.y()); | 784 web_contents_->MoveRangeSelectionExtent(gfx::Point(extent.x(), extent.y())); |
|
jdduke (slow)
2014/11/03 17:58:48
I wonder, will the renderer guard against the sele
christiank
2014/11/04 09:44:28
Yes it should. WebLocalFrameImpl::moveRangeSelecti
| |
| 786 gfx::Point end_point = gfx::Point(end.x(), end.y()); | 785 } |
| 787 if (start_point == end_point) | 786 |
| 787 void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& base, | |
| 788 const gfx::PointF& extent) { | |
| 789 if (!web_contents_) | |
| 788 return; | 790 return; |
| 789 | 791 |
| 790 web_contents_->SelectRange(start_point, end_point); | 792 gfx::Point base_point = gfx::Point(base.x(), base.y()); |
| 793 gfx::Point extent_point = gfx::Point(extent.x(), extent.y()); | |
| 794 if (base_point == extent_point) | |
| 795 return; | |
| 796 | |
| 797 web_contents_->SelectRange(base_point, extent_point); | |
| 791 } | 798 } |
| 792 | 799 |
| 793 ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const { | 800 ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const { |
| 794 return view_android_; | 801 return view_android_; |
| 795 } | 802 } |
| 796 | 803 |
| 797 ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const { | 804 ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const { |
| 798 return window_android_; | 805 return window_android_; |
| 799 } | 806 } |
| 800 | 807 |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 |
| OLD | NEW |