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

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

Issue 13688004: Location/size change notification when external rendering is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put notification hook under ifdef's to minimize performance implication on other platforms 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
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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void ContentViewCoreImpl::NotifyGeometryChange(int player_id,
606 gfx::RectF& rect) {
607 JNIEnv* env = AttachCurrentThread();
608
609 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
610 if (obj.is_null())
611 return;
612
613 Java_ContentViewCore_notifyGeometryChange(env,
614 obj.obj(),
615 static_cast<jint>(player_id),
616 static_cast<jfloat>(rect.x()),
617 static_cast<jfloat>(rect.y()),
618 static_cast<jfloat>(rect.width()),
619 static_cast<jfloat>(rect.height()));
620 }
621
605 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { 622 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const {
606 JNIEnv* env = AttachCurrentThread(); 623 JNIEnv* env = AttachCurrentThread();
607 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); 624 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
608 if (j_obj.is_null()) 625 if (j_obj.is_null())
609 return gfx::Size(); 626 return gfx::Size();
610 return gfx::Size( 627 return gfx::Size(
611 Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()), 628 Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()),
612 Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj())); 629 Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj()));
613 } 630 }
614 631
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 reinterpret_cast<WebContents*>(native_web_contents), 1496 reinterpret_cast<WebContents*>(native_web_contents),
1480 reinterpret_cast<ui::WindowAndroid*>(native_window)); 1497 reinterpret_cast<ui::WindowAndroid*>(native_window));
1481 return reinterpret_cast<jint>(view); 1498 return reinterpret_cast<jint>(view);
1482 } 1499 }
1483 1500
1484 bool RegisterContentViewCore(JNIEnv* env) { 1501 bool RegisterContentViewCore(JNIEnv* env) {
1485 return RegisterNativesImpl(env); 1502 return RegisterNativesImpl(env);
1486 } 1503 }
1487 1504
1488 } // namespace content 1505 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698