| 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 JNIEnv* env = AttachCurrentThread(); | 595 JNIEnv* env = AttachCurrentThread(); |
| 596 | 596 |
| 597 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 597 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 598 if (obj.is_null()) | 598 if (obj.is_null()) |
| 599 return; | 599 return; |
| 600 | 600 |
| 601 Java_ContentViewCore_requestExternalVideoSurface( | 601 Java_ContentViewCore_requestExternalVideoSurface( |
| 602 env, obj.obj(), static_cast<jint>(player_id)); | 602 env, obj.obj(), static_cast<jint>(player_id)); |
| 603 } | 603 } |
| 604 | 604 |
| 605 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContentVideoViewClient() { |
| 606 JNIEnv* env = AttachCurrentThread(); |
| 607 |
| 608 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 609 if (obj.is_null()) |
| 610 return ScopedJavaLocalRef<jobject>(); |
| 611 |
| 612 return Java_ContentViewCore_getContentVideoViewClient(env, obj.obj()); |
| 613 } |
| 614 |
| 605 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { | 615 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { |
| 606 JNIEnv* env = AttachCurrentThread(); | 616 JNIEnv* env = AttachCurrentThread(); |
| 607 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 617 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 608 if (j_obj.is_null()) | 618 if (j_obj.is_null()) |
| 609 return gfx::Size(); | 619 return gfx::Size(); |
| 610 return gfx::Size( | 620 return gfx::Size( |
| 611 Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()), | 621 Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()), |
| 612 Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj())); | 622 Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj())); |
| 613 } | 623 } |
| 614 | 624 |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 reinterpret_cast<WebContents*>(native_web_contents), | 1489 reinterpret_cast<WebContents*>(native_web_contents), |
| 1480 reinterpret_cast<ui::WindowAndroid*>(native_window)); | 1490 reinterpret_cast<ui::WindowAndroid*>(native_window)); |
| 1481 return reinterpret_cast<jint>(view); | 1491 return reinterpret_cast<jint>(view); |
| 1482 } | 1492 } |
| 1483 | 1493 |
| 1484 bool RegisterContentViewCore(JNIEnv* env) { | 1494 bool RegisterContentViewCore(JNIEnv* env) { |
| 1485 return RegisterNativesImpl(env); | 1495 return RegisterNativesImpl(env); |
| 1486 } | 1496 } |
| 1487 | 1497 |
| 1488 } // namespace content | 1498 } // namespace content |
| OLD | NEW |