OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 if (obj.is_null()) | 537 if (obj.is_null()) |
538 return; | 538 return; |
539 ScopedJavaLocalRef<jobject> anchor_rect( | 539 ScopedJavaLocalRef<jobject> anchor_rect( |
540 java_object_->CreateJavaRect(env, params.anchor_rect, GetDpiScale())); | 540 java_object_->CreateJavaRect(env, params.anchor_rect, GetDpiScale())); |
541 ScopedJavaLocalRef<jobject> focus_rect( | 541 ScopedJavaLocalRef<jobject> focus_rect( |
542 java_object_->CreateJavaRect(env, params.focus_rect, GetDpiScale())); | 542 java_object_->CreateJavaRect(env, params.focus_rect, GetDpiScale())); |
543 Java_ContentViewCore_onSelectionBoundsChanged(env, obj.obj(), | 543 Java_ContentViewCore_onSelectionBoundsChanged(env, obj.obj(), |
544 anchor_rect.obj(), | 544 anchor_rect.obj(), |
545 params.anchor_dir, | 545 params.anchor_dir, |
546 focus_rect.obj(), | 546 focus_rect.obj(), |
547 params.focus_dir); | 547 params.focus_dir, |
| 548 params.is_anchor_first); |
548 } | 549 } |
549 | 550 |
550 void ContentViewCoreImpl::ShowPastePopup(int x, int y) { | 551 void ContentViewCoreImpl::ShowPastePopup(int x, int y) { |
551 JNIEnv* env = AttachCurrentThread(); | 552 JNIEnv* env = AttachCurrentThread(); |
552 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 553 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
553 if (obj.is_null()) | 554 if (obj.is_null()) |
554 return; | 555 return; |
555 Java_ContentViewCore_showPastePopup(env, obj.obj(), static_cast<jint>(x), | 556 Java_ContentViewCore_showPastePopup(env, obj.obj(), static_cast<jint>(x), |
556 static_cast<jint>(y)); | 557 static_cast<jint>(y)); |
557 } | 558 } |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 1398 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
1398 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 1399 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
1399 return false; | 1400 return false; |
1400 } | 1401 } |
1401 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 1402 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
1402 | 1403 |
1403 return RegisterNativesImpl(env) >= 0; | 1404 return RegisterNativesImpl(env) >= 0; |
1404 } | 1405 } |
1405 | 1406 |
1406 } // namespace content | 1407 } // namespace content |
OLD | NEW |