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( |
| 781 const gfx::PointF& end) { | 781 const gfx::PointF& position) { |
|
jdduke (slow)
2014/10/21 16:57:36
Nit: Let's call this |extent| instead of |position
| |
| 782 if (!web_contents_) | 782 if (!web_contents_) |
| 783 return; | 783 return; |
| 784 | 784 |
| 785 gfx::Point start_point = gfx::Point(start.x(), start.y()); | 785 web_contents_->MoveRangeSelectionExtent( |
| 786 gfx::Point end_point = gfx::Point(end.x(), end.y()); | 786 gfx::Point(position.x(), position.y())); |
| 787 if (start_point == end_point) | 787 } |
| 788 | |
| 789 void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& base, | |
| 790 const gfx::PointF& extent) { | |
| 791 if (!web_contents_) | |
| 788 return; | 792 return; |
| 789 | 793 |
| 790 web_contents_->SelectRange(start_point, end_point); | 794 gfx::Point base_point = gfx::Point(base.x(), base.y()); |
| 795 gfx::Point extent_point = gfx::Point(extent.x(), extent.y()); | |
| 796 if (base_point == extent_point) | |
| 797 return; | |
| 798 | |
| 799 web_contents_->SelectRange(base_point, extent_point); | |
| 791 } | 800 } |
| 792 | 801 |
| 793 ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const { | 802 ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const { |
| 794 return view_android_; | 803 return view_android_; |
| 795 } | 804 } |
| 796 | 805 |
| 797 ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const { | 806 ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const { |
| 798 return window_android_; | 807 return window_android_; |
| 799 } | 808 } |
| 800 | 809 |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1338 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1347 reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 1339 retained_objects_set); | 1348 retained_objects_set); |
| 1340 return reinterpret_cast<intptr_t>(view); | 1349 return reinterpret_cast<intptr_t>(view); |
| 1341 } | 1350 } |
| 1342 | 1351 |
| 1343 bool RegisterContentViewCore(JNIEnv* env) { | 1352 bool RegisterContentViewCore(JNIEnv* env) { |
| 1344 return RegisterNativesImpl(env); | 1353 return RegisterNativesImpl(env); |
| 1345 } | 1354 } |
| 1346 | 1355 |
| 1347 } // namespace content | 1356 } // namespace content |
| OLD | NEW |