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

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

Issue 23983036: [Android] Provide synchronized input flush with BeginFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 2 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 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 "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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { 708 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) {
709 layer->RemoveFromParent(); 709 layer->RemoveFromParent();
710 } 710 }
711 711
712 void ContentViewCoreImpl::LoadUrl( 712 void ContentViewCoreImpl::LoadUrl(
713 NavigationController::LoadURLParams& params) { 713 NavigationController::LoadURLParams& params) {
714 GetWebContents()->GetController().LoadURLWithParams(params); 714 GetWebContents()->GetController().LoadURLWithParams(params);
715 UpdateTabCrashedFlag(); 715 UpdateTabCrashedFlag();
716 } 716 }
717 717
718 void ContentViewCoreImpl::SetNeedsBeginFrame(bool enabled) { 718 void ContentViewCoreImpl::AddBeginFrameSubscriber() {
719 JNIEnv* env = AttachCurrentThread(); 719 JNIEnv* env = AttachCurrentThread();
720 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 720 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
721 if (obj.is_null()) 721 if (obj.is_null())
722 return; 722 return;
723 Java_ContentViewCore_setVSyncNotificationEnabled( 723 Java_ContentViewCore_addVSyncSubscriber(env, obj.obj());
724 env, obj.obj(), static_cast<jboolean>(enabled)); 724 }
725
726 void ContentViewCoreImpl::RemoveBeginFrameSubscriber() {
727 JNIEnv* env = AttachCurrentThread();
728 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
729 if (obj.is_null())
730 return;
731 Java_ContentViewCore_removeVSyncSubscriber(env, obj.obj());
725 } 732 }
726 733
727 void ContentViewCoreImpl::SetNeedsAnimate() { 734 void ContentViewCoreImpl::SetNeedsAnimate() {
728 JNIEnv* env = AttachCurrentThread(); 735 JNIEnv* env = AttachCurrentThread();
729 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 736 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
730 if (obj.is_null()) 737 if (obj.is_null())
731 return; 738 return;
732 Java_ContentViewCore_setNeedsAnimate(env, obj.obj()); 739 Java_ContentViewCore_setNeedsAnimate(env, obj.obj());
733 } 740 }
734 741
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 reinterpret_cast<ui::ViewAndroid*>(view_android), 1616 reinterpret_cast<ui::ViewAndroid*>(view_android),
1610 reinterpret_cast<ui::WindowAndroid*>(window_android)); 1617 reinterpret_cast<ui::WindowAndroid*>(window_android));
1611 return reinterpret_cast<jint>(view); 1618 return reinterpret_cast<jint>(view);
1612 } 1619 }
1613 1620
1614 bool RegisterContentViewCore(JNIEnv* env) { 1621 bool RegisterContentViewCore(JNIEnv* env) {
1615 return RegisterNativesImpl(env); 1622 return RegisterNativesImpl(env);
1616 } 1623 }
1617 1624
1618 } // namespace content 1625 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698