| Index: android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
|
| index 7de19e55eeb38679b780ae37c9ca14c5a65e7038..fe42ad3a80dba7e5a7af63349c446c34fd68cf1d 100644
|
| --- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
|
| +++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
|
| @@ -52,6 +52,12 @@ public abstract class AwContentsClient {
|
|
|
| private double mDIPScale;
|
|
|
| + // Last background color reported from the renderer. Holds the sentinal value INVALID_COLOR
|
| + // if not valid.
|
| + private int mCachedRendererBackgroundColor = INVALID_COLOR;
|
| +
|
| + private static final int INVALID_COLOR = 0;
|
| +
|
| class AwWebContentsObserver extends WebContentsObserverAndroid {
|
| public AwWebContentsObserver(ContentViewCore contentViewCore) {
|
| super(contentViewCore);
|
| @@ -90,6 +96,12 @@ public abstract class AwContentsClient {
|
| }
|
|
|
| private class AwContentViewClient extends ContentViewClient {
|
| + @Override
|
| + public void onBackgroundColorChanged(int color) {
|
| + // Avoid storing the sentinal INVALID_COLOR (note that both 0 and 1 are both
|
| + // fully transparent so this transpose makes no visible difference).
|
| + mCachedRendererBackgroundColor = color == INVALID_COLOR ? 1 : color;
|
| + }
|
|
|
| @Override
|
| public void onScaleChanged(float oldScale, float newScale) {
|
| @@ -174,6 +186,15 @@ public abstract class AwContentsClient {
|
| return mContentViewClient;
|
| }
|
|
|
| + final int getCachedRendererBackgroundColor() {
|
| + assert isCachedRendererBackgroundColorValid();
|
| + return mCachedRendererBackgroundColor;
|
| + }
|
| +
|
| + final boolean isCachedRendererBackgroundColorValid() {
|
| + return mCachedRendererBackgroundColor != INVALID_COLOR;
|
| + }
|
| +
|
| //--------------------------------------------------------------------------------------------
|
| // WebView specific methods that map directly to WebViewClient / WebChromeClient
|
| //--------------------------------------------------------------------------------------------
|
|
|