Add visual state callbacks to the WebView.

Registering a visual state callback allows the caller to be notified
after the commit, activation and swap of the current (or future) state
of the DOM tree has occurred. At the point at which the callback is
called, the caller can be sure that any DOM updates made prior to
the registration are ready to be drawn in the next WebView#onDraw.

We also provide a convenience callback related to the visual state:

* WebViewClient.onPageCommitVisible; called at the earliest point at
  which the next draw will not render contents from the previously
  loaded page.

Bug: 6375170
Change-Id: I17e706b6e6ba4a8c28c835552687c9f7a4623024
diff --git a/core/java/android/webkit/WebViewProvider.java b/core/java/android/webkit/WebViewProvider.java
index 0cdb875..fa2ce1b 100644
--- a/core/java/android/webkit/WebViewProvider.java
+++ b/core/java/android/webkit/WebViewProvider.java
@@ -40,6 +40,8 @@
 import android.view.inputmethod.InputConnection;
 import android.webkit.WebView.HitTestResult;
 import android.webkit.WebView.PictureListener;
+import android.webkit.WebView.VisualStateCallback;
+
 
 import java.io.BufferedWriter;
 import java.io.File;
@@ -146,6 +148,8 @@
 
     public boolean pageDown(boolean bottom);
 
+    public void insertVisualStateCallback(long requestId, VisualStateCallback callback);
+
     public void clearView();
 
     public Picture capturePicture();