Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 13669003: Refactoring ContentVideoViewContextDelegate.java (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 JNIEnv* env = AttachCurrentThread(); 604 JNIEnv* env = AttachCurrentThread();
605 605
606 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 606 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
607 if (obj.is_null()) 607 if (obj.is_null())
608 return; 608 return;
609 609
610 Java_ContentViewCore_requestExternalVideoSurface( 610 Java_ContentViewCore_requestExternalVideoSurface(
611 env, obj.obj(), static_cast<jint>(player_id)); 611 env, obj.obj(), static_cast<jint>(player_id));
612 } 612 }
613 613
614 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContentVideoViewClient() {
615 JNIEnv* env = AttachCurrentThread();
616
617 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
618 if (obj.is_null())
619 return ScopedJavaLocalRef<jobject>();
620
621 return Java_ContentViewCore_getContentVideoViewClient(env, obj.obj());
622 }
623
624 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() {
625 JNIEnv* env = AttachCurrentThread();
626
627 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
628 if (obj.is_null())
629 return ScopedJavaLocalRef<jobject>();
630
631 return Java_ContentViewCore_getContext(env, obj.obj());
632 }
633
614 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { 634 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const {
615 JNIEnv* env = AttachCurrentThread(); 635 JNIEnv* env = AttachCurrentThread();
616 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); 636 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
617 if (j_obj.is_null()) 637 if (j_obj.is_null())
618 return gfx::Size(); 638 return gfx::Size();
619 return gfx::Size( 639 return gfx::Size(
620 Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()), 640 Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()),
621 Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj())); 641 Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj()));
622 } 642 }
623 643
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 reinterpret_cast<WebContents*>(native_web_contents), 1497 reinterpret_cast<WebContents*>(native_web_contents),
1478 reinterpret_cast<ui::WindowAndroid*>(native_window)); 1498 reinterpret_cast<ui::WindowAndroid*>(native_window));
1479 return reinterpret_cast<jint>(view); 1499 return reinterpret_cast<jint>(view);
1480 } 1500 }
1481 1501
1482 bool RegisterContentViewCore(JNIEnv* env) { 1502 bool RegisterContentViewCore(JNIEnv* env) {
1483 return RegisterNativesImpl(env); 1503 return RegisterNativesImpl(env);
1484 } 1504 }
1485 1505
1486 } // namespace content 1506 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698