| 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 612       env, | 612       env, | 
| 613       obj.obj(), | 613       obj.obj(), | 
| 614       static_cast<jint>(player_id), | 614       static_cast<jint>(player_id), | 
| 615       static_cast<jboolean>(is_request), | 615       static_cast<jboolean>(is_request), | 
| 616       static_cast<jfloat>(rect.x()), | 616       static_cast<jfloat>(rect.x()), | 
| 617       static_cast<jfloat>(rect.y()), | 617       static_cast<jfloat>(rect.y()), | 
| 618       static_cast<jfloat>(rect.width()), | 618       static_cast<jfloat>(rect.width()), | 
| 619       static_cast<jfloat>(rect.height())); | 619       static_cast<jfloat>(rect.height())); | 
| 620 } | 620 } | 
| 621 | 621 | 
|  | 622 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContentVideoViewClient() { | 
|  | 623   JNIEnv* env = AttachCurrentThread(); | 
|  | 624 | 
|  | 625   ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 
|  | 626   if (obj.is_null()) | 
|  | 627     return ScopedJavaLocalRef<jobject>(); | 
|  | 628 | 
|  | 629   return Java_ContentViewCore_getContentVideoViewClient(env, obj.obj()); | 
|  | 630 } | 
|  | 631 | 
|  | 632 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() { | 
|  | 633   JNIEnv* env = AttachCurrentThread(); | 
|  | 634 | 
|  | 635   ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 
|  | 636   if (obj.is_null()) | 
|  | 637     return ScopedJavaLocalRef<jobject>(); | 
|  | 638 | 
|  | 639   return Java_ContentViewCore_getContext(env, obj.obj()); | 
|  | 640 } | 
|  | 641 | 
| 622 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { | 642 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { | 
| 623   JNIEnv* env = AttachCurrentThread(); | 643   JNIEnv* env = AttachCurrentThread(); | 
| 624   ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 644   ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 
| 625   if (j_obj.is_null()) | 645   if (j_obj.is_null()) | 
| 626     return gfx::Size(); | 646     return gfx::Size(); | 
| 627   return gfx::Size( | 647   return gfx::Size( | 
| 628       Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()), | 648       Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()), | 
| 629       Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj())); | 649       Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj())); | 
| 630 } | 650 } | 
| 631 | 651 | 
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1568       reinterpret_cast<ui::ViewAndroid*>(view_android), | 1588       reinterpret_cast<ui::ViewAndroid*>(view_android), | 
| 1569       reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1589       reinterpret_cast<ui::WindowAndroid*>(window_android)); | 
| 1570   return reinterpret_cast<jint>(view); | 1590   return reinterpret_cast<jint>(view); | 
| 1571 } | 1591 } | 
| 1572 | 1592 | 
| 1573 bool RegisterContentViewCore(JNIEnv* env) { | 1593 bool RegisterContentViewCore(JNIEnv* env) { | 
| 1574   return RegisterNativesImpl(env); | 1594   return RegisterNativesImpl(env); | 
| 1575 } | 1595 } | 
| 1576 | 1596 | 
| 1577 }  // namespace content | 1597 }  // namespace content | 
| OLD | NEW | 
|---|