Chromium Code Reviews| 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..1e7d41b4aaabafa47197d31a7398e673b16e3d4b 100644 |
| --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java |
| +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java |
| @@ -87,6 +87,8 @@ public class AwContents { |
| // produce little visible difference. |
| private static final float ZOOM_CONTROLS_EPSILON = 0.007f; |
| + private WindowAndroid mWindowAndroid; |
| + |
| /** |
| * WebKit hit test related data strcutre. These are used to implement |
| * getHitTestResult, requestFocusNodeHref, requestImageRef methods in WebView. |
| @@ -614,12 +616,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 +756,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,7 +2044,7 @@ public class AwContents { |
| @CalledByNative |
| private void postInvalidateOnAnimation() { |
| - if (SUPPORTS_ON_ANIMATION) { |
| + if (SUPPORTS_ON_ANIMATION && mWindowAndroid != null && !mWindowAndroid.isInsideVSync()) { |
|
boliu
2014/08/20 02:54:16
Is it possible for mWindowAndroid to be null here?
hush (inactive)
2014/08/20 03:47:20
Not possible. postInvalidateOnAnimation must be ca
|
| mContainerView.postInvalidateOnAnimation(); |
| } else { |
| mContainerView.postInvalidate(); |
|
boliu
2014/08/20 02:54:16
we want invalidate here, not postInvalidate
hush (inactive)
2014/08/20 03:47:21
Done.
|