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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 void ContentViewCoreImpl::OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip) { | 1202 void ContentViewCoreImpl::OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip) { |
1203 JNIEnv* env = AttachCurrentThread(); | 1203 JNIEnv* env = AttachCurrentThread(); |
1204 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1204 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1205 if (obj.is_null()) | 1205 if (obj.is_null()) |
1206 return; | 1206 return; |
1207 Java_ContentViewCore_onShowUnhandledTapUIIfNeeded( | 1207 Java_ContentViewCore_onShowUnhandledTapUIIfNeeded( |
1208 env, obj, static_cast<jint>(x_dip * dpi_scale()), | 1208 env, obj, static_cast<jint>(x_dip * dpi_scale()), |
1209 static_cast<jint>(y_dip * dpi_scale())); | 1209 static_cast<jint>(y_dip * dpi_scale())); |
1210 } | 1210 } |
1211 | 1211 |
| 1212 void ContentViewCoreImpl::OnSelectWordAroundCaretAck(bool did_select, |
| 1213 int start_adjust, |
| 1214 int end_adjust) { |
| 1215 JNIEnv* env = AttachCurrentThread(); |
| 1216 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1217 if (obj.is_null()) |
| 1218 return; |
| 1219 Java_ContentViewCore_onSelectWordAroundCaretAck(env, obj, did_select, |
| 1220 start_adjust, end_adjust); |
| 1221 } |
| 1222 |
1212 void ContentViewCoreImpl::HidePopupsAndPreserveSelection() { | 1223 void ContentViewCoreImpl::HidePopupsAndPreserveSelection() { |
1213 JNIEnv* env = AttachCurrentThread(); | 1224 JNIEnv* env = AttachCurrentThread(); |
1214 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1225 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1215 if (obj.is_null()) | 1226 if (obj.is_null()) |
1216 return; | 1227 return; |
1217 | 1228 |
1218 Java_ContentViewCore_hidePopupsAndPreserveSelection(env, obj); | 1229 Java_ContentViewCore_hidePopupsAndPreserveSelection(env, obj); |
1219 } | 1230 } |
1220 | 1231 |
1221 void ContentViewCoreImpl::WebContentsDestroyed() { | 1232 void ContentViewCoreImpl::WebContentsDestroyed() { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 return ScopedJavaLocalRef<jobject>(); | 1275 return ScopedJavaLocalRef<jobject>(); |
1265 | 1276 |
1266 return view->GetJavaObject(); | 1277 return view->GetJavaObject(); |
1267 } | 1278 } |
1268 | 1279 |
1269 bool RegisterContentViewCore(JNIEnv* env) { | 1280 bool RegisterContentViewCore(JNIEnv* env) { |
1270 return RegisterNativesImpl(env); | 1281 return RegisterNativesImpl(env); |
1271 } | 1282 } |
1272 | 1283 |
1273 } // namespace content | 1284 } // namespace content |
OLD | NEW |