Index: android_webview/java/src/org/chromium/android_webview/AwContents.java |
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java |
index 8338559035220c8762571e0d4a9627c13eeb1464..e556de8b69aa1aa0cc81032fccebf929b901988f 100644 |
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java |
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java |
@@ -181,6 +181,7 @@ public class AwContents { |
private final AwLayoutChangeListener mLayoutChangeListener; |
private final Context mContext; |
private ContentViewCore mContentViewCore; |
+ private WindowAndroid mWindowAndroid; |
private final AwContentsClient mContentsClient; |
private final AwContentViewClient mContentViewClient; |
private WebContentsObserverAndroid mWebContentsObserver; |
@@ -614,12 +615,11 @@ public class AwContents { |
Context context, InternalAccessDelegate internalDispatcher, long nativeWebContents, |
GestureStateListener gestureStateListener, |
ContentViewClient contentViewClient, |
- ContentViewCore.ZoomControlsDelegate zoomControlsDelegate) { |
+ ContentViewCore.ZoomControlsDelegate zoomControlsDelegate, |
+ WindowAndroid windowAndroid) { |
ContentViewCore contentViewCore = new ContentViewCore(context); |
contentViewCore.initialize(containerView, internalDispatcher, nativeWebContents, |
- context instanceof Activity ? |
- new ActivityWindowAndroid((Activity) context) : |
- new WindowAndroid(context.getApplicationContext())); |
+ windowAndroid); |
contentViewCore.addGestureStateListener(gestureStateListener); |
contentViewCore.setContentViewClient(contentViewClient); |
contentViewCore.setZoomControlsDelegate(zoomControlsDelegate); |
@@ -755,9 +755,13 @@ public class AwContents { |
mCleanupReference = new CleanupReference(this, new DestroyRunnable(mNativeAwContents)); |
long nativeWebContents = nativeGetWebContents(mNativeAwContents); |
+ |
+ mWindowAndroid = mContext instanceof Activity ? |
+ new ActivityWindowAndroid((Activity) mContext) : |
+ new WindowAndroid(mContext.getApplicationContext()); |
mContentViewCore = createAndInitializeContentViewCore( |
mContainerView, mContext, mInternalAccessAdapter, nativeWebContents, |
- new AwGestureStateListener(), mContentViewClient, mZoomControls); |
+ new AwGestureStateListener(), mContentViewClient, mZoomControls, mWindowAndroid); |
nativeSetJavaPeers(mNativeAwContents, this, mWebContentsDelegate, mContentsClientBridge, |
mIoThreadClient, mInterceptNavigationDelegate); |
installWebContentsObserver(); |
@@ -2039,10 +2043,10 @@ public class AwContents { |
@CalledByNative |
private void postInvalidateOnAnimation() { |
- if (SUPPORTS_ON_ANIMATION) { |
+ if (SUPPORTS_ON_ANIMATION && !mWindowAndroid.isInsideVSync()) { |
mContainerView.postInvalidateOnAnimation(); |
} else { |
- mContainerView.postInvalidate(); |
+ mContainerView.invalidate(); |
} |
} |