Fixup browser after hidden API refactor

Interdepends on https://android-git.corp.google.com/g/#/c/198193

Change-Id: I9f44c0f4f84674965b7afc652420986314e2fc8e
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 28734bd..0cf598f 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -64,6 +64,7 @@
 import android.webkit.WebView.PictureListener;
 import android.webkit.WebViewClassic;
 import android.webkit.WebViewClient;
+import android.webkit.WebViewClientClassicExt;
 import android.widget.CheckBox;
 import android.widget.Toast;
 
@@ -322,7 +323,7 @@
     // WebViewClient implementation for the main WebView
     // -------------------------------------------------------------------------
 
-    private final WebViewClient mWebViewClient = new WebViewClient() {
+    private final WebViewClientClassicExt mWebViewClient = new WebViewClientClassicExt() {
         private Message mDontResend;
         private Message mResend;
 
@@ -1045,12 +1046,12 @@
 
     // Subclass of WebViewClient used in subwindows to notify the main
     // WebViewClient of certain WebView activities.
-    private static class SubWindowClient extends WebViewClient {
+    private static class SubWindowClient extends WebViewClientClassicExt {
         // The main WebViewClient.
-        private final WebViewClient mClient;
+        private final WebViewClientClassicExt mClient;
         private final WebViewController mController;
 
-        SubWindowClient(WebViewClient client, WebViewController controller) {
+        SubWindowClient(WebViewClientClassicExt client, WebViewController controller) {
             mClient = client;
             mController = controller;
         }
diff --git a/tests/src/com/android/browser/TestWebViewClient.java b/tests/src/com/android/browser/TestWebViewClient.java
index 208a822..6ab40dd 100644
--- a/tests/src/com/android/browser/TestWebViewClient.java
+++ b/tests/src/com/android/browser/TestWebViewClient.java
@@ -25,6 +25,7 @@
 import android.webkit.SslErrorHandler;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
+import android.webkit.WebViewClientClassicExt;
 
 /**
  *
@@ -33,7 +34,7 @@
  * Wraps around existing client so that specific methods can be overridden if needed.
  *
  */
-abstract class TestWebViewClient extends WebViewClient {
+abstract class TestWebViewClient extends WebViewClientClassicExt {
 
   private WebViewClient mWrappedClient;
 
@@ -105,7 +106,11 @@
   @Override
   public void onReceivedClientCertRequest(WebView view, ClientCertRequestHandler handler,
           String host_and_port) {
-      mWrappedClient.onReceivedClientCertRequest(view, handler, host_and_port);
+    if (mWrappedClient instanceof WebViewClientClassicExt) {
+      ((WebViewClientClassicExt) mWrappedClient).onReceivedClientCertRequest(view, handler, host_and_port);
+    } else {
+      super.onReceivedClientCertRequest(view, handler, host_and_port);
+    }
   }
 
   /** {@inheritDoc} */