| 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 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 void ContentViewCoreImpl::OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip) { | 1483 void ContentViewCoreImpl::OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip) { |
| 1484 JNIEnv* env = AttachCurrentThread(); | 1484 JNIEnv* env = AttachCurrentThread(); |
| 1485 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1485 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1486 if (obj.is_null()) | 1486 if (obj.is_null()) |
| 1487 return; | 1487 return; |
| 1488 Java_ContentViewCore_onShowUnhandledTapUIIfNeeded( | 1488 Java_ContentViewCore_onShowUnhandledTapUIIfNeeded( |
| 1489 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()), | 1489 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()), |
| 1490 static_cast<jint>(y_dip * dpi_scale())); | 1490 static_cast<jint>(y_dip * dpi_scale())); |
| 1491 } | 1491 } |
| 1492 | 1492 |
| 1493 float ContentViewCoreImpl::GetScaleFactor() const { | |
| 1494 return page_scale_ * dpi_scale_; | |
| 1495 } | |
| 1496 | |
| 1497 void ContentViewCoreImpl::OnSmartClipDataExtracted( | 1493 void ContentViewCoreImpl::OnSmartClipDataExtracted( |
| 1498 const base::string16& text, | 1494 const base::string16& text, |
| 1499 const base::string16& html, | 1495 const base::string16& html, |
| 1500 const gfx::Rect& clip_rect) { | 1496 const gfx::Rect& clip_rect) { |
| 1501 JNIEnv* env = AttachCurrentThread(); | 1497 JNIEnv* env = AttachCurrentThread(); |
| 1502 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1498 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1503 if (obj.is_null()) | 1499 if (obj.is_null()) |
| 1504 return; | 1500 return; |
| 1505 ScopedJavaLocalRef<jstring> jtext = ConvertUTF16ToJavaString(env, text); | 1501 ScopedJavaLocalRef<jstring> jtext = ConvertUTF16ToJavaString(env, text); |
| 1506 ScopedJavaLocalRef<jstring> jhtml = ConvertUTF16ToJavaString(env, html); | 1502 ScopedJavaLocalRef<jstring> jhtml = ConvertUTF16ToJavaString(env, html); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1575 return ScopedJavaLocalRef<jobject>(); | 1571 return ScopedJavaLocalRef<jobject>(); |
| 1576 | 1572 |
| 1577 return view->GetJavaObject(); | 1573 return view->GetJavaObject(); |
| 1578 } | 1574 } |
| 1579 | 1575 |
| 1580 bool RegisterContentViewCore(JNIEnv* env) { | 1576 bool RegisterContentViewCore(JNIEnv* env) { |
| 1581 return RegisterNativesImpl(env); | 1577 return RegisterNativesImpl(env); |
| 1582 } | 1578 } |
| 1583 | 1579 |
| 1584 } // namespace content | 1580 } // namespace content |
| OLD | NEW |