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

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

Issue 784343002: [draft] flush visual state prototype (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java » ('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 3ee10deafe17e003768787f98b007027fe113eda..5579302375128e3667cdf6a4a460cd2496ac8e7b 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -2020,6 +2020,18 @@ public class AwContents implements SmartClipProvider {
if (!isDestroyed()) nativeSetJsOnlineProperty(mNativeAwContents, networkUp);
}
+ /**
+ * TODO: docs
+ */
+ public abstract static class VisualStateFlushCallback {
+ public abstract void onComplete();
+ public abstract void onFailure(int reason);
+ }
+
+ public void flushVisualState(VisualStateFlushCallback callback) {
+ nativeFlushVisualState(mNativeAwContents, callback);
+ }
+
//--------------------------------------------------------------------------------------------
// Methods called from native via JNI
//--------------------------------------------------------------------------------------------
@@ -2123,6 +2135,15 @@ public class AwContents implements SmartClipProvider {
mContentsClient.getCallbackHelper().postOnNewPicture(mPictureListenerContentProvider);
}
+ @CalledByNative
+ public static void flushVisualStateCallback(VisualStateFlushCallback callback, int value) {
+ if (value == 0) {
+ callback.onComplete();
+ } else {
+ callback.onFailure(value);
+ }
+ }
+
// Called as a result of nativeUpdateLastHitTestData.
@CalledByNative
private void updateHitTestData(
@@ -2688,6 +2709,8 @@ public class AwContents implements SmartClipProvider {
private native long nativeGetAwDrawGLViewContext(long nativeAwContents);
private native long nativeCapturePicture(long nativeAwContents, int width, int height);
private native void nativeEnableOnNewPicture(long nativeAwContents, boolean enabled);
+ private native void nativeFlushVisualState(long nativeAwContents,
+ VisualStateFlushCallback callback);
private native void nativeClearView(long nativeAwContents);
private native void nativeSetExtraHeadersForUrl(long nativeAwContents,
String url, String extraHeaders);
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698