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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 1377593003: Refactor BrowserViewRenderer to support page visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test compilation Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/browser/test/rendering_test.cc ('k') | android_webview/native/aw_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 29c1e28c9eec017494071563fca0fd67cbab6cd5..51516786c68677d7d558adf6e124f5ef0493aba4 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -42,7 +42,6 @@ import android.webkit.ValueCallback;
import org.chromium.android_webview.permission.AwGeolocationCallback;
import org.chromium.android_webview.permission.AwPermissionRequest;
-import org.chromium.base.CommandLine;
import org.chromium.base.LocaleUtils;
import org.chromium.base.ThreadUtils;
import org.chromium.base.TraceEvent;
@@ -106,9 +105,6 @@ public class AwContents implements SmartClipProvider,
private static final boolean FORCE_AUXILIARY_BITMAP_RENDERING =
"goldfish".equals(Build.HARDWARE);
- // Matches kEnablePageVisibility.
- private static final String ENABLE_PAGE_VISIBILITY = "enable-page-visibility";
-
/**
* WebKit hit test related data structure. These are used to implement
* getHitTestResult, requestFocusNodeHref, requestImageRef methods in WebView.
@@ -236,8 +232,6 @@ public class AwContents implements SmartClipProvider,
private final AwSettings mSettings;
private final ScrollAccessibilityHelper mScrollAccessibilityHelper;
- // Visibility related state.
- private final boolean mEnablePageVisibility;
private boolean mIsPaused;
private boolean mIsViewVisible;
private boolean mIsWindowVisible;
@@ -721,7 +715,6 @@ public class AwContents implements SmartClipProvider,
mScrollOffsetManager =
dependencyFactory.createScrollOffsetManager(new AwScrollOffsetManagerDelegate());
mScrollAccessibilityHelper = new ScrollAccessibilityHelper(mContainerView);
- mEnablePageVisibility = CommandLine.getInstance().hasSwitch(ENABLE_PAGE_VISIBILITY);
setOverScrollMode(mContainerView.getOverScrollMode());
setScrollBarStyle(mInternalAccessAdapter.super_getScrollBarStyle());
@@ -2287,10 +2280,7 @@ public class AwContents implements SmartClipProvider,
private void updateContentViewCoreVisibility() {
if (isDestroyed()) return;
- boolean contentViewCoreVisible = !mIsPaused;
- if (mEnablePageVisibility) {
- contentViewCoreVisible = contentViewCoreVisible && mIsWindowVisible && mIsViewVisible;
- }
+ boolean contentViewCoreVisible = nativeIsVisible(mNativeAwContents);
if (contentViewCoreVisible && !mIsContentViewCoreVisible) {
mContentViewCore.onShow();
@@ -3123,7 +3113,8 @@ public class AwContents implements SmartClipProvider,
private native void nativeSetWindowVisibility(long nativeAwContents, boolean visible);
private native void nativeSetIsPaused(long nativeAwContents, boolean paused);
private native void nativeOnAttachedToWindow(long nativeAwContents, int w, int h);
- private static native void nativeOnDetachedFromWindow(long nativeAwContents);
+ private native void nativeOnDetachedFromWindow(long nativeAwContents);
+ private native boolean nativeIsVisible(long nativeAwContents);
private native void nativeSetDipScale(long nativeAwContents, float dipScale);
// Returns null if save state fails.
« no previous file with comments | « android_webview/browser/test/rendering_test.cc ('k') | android_webview/native/aw_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698