diff --git a/api/current.xml b/api/current.xml index 4996e6aeb6de7..978b96e432dba 100644 --- a/api/current.xml +++ b/api/current.xml @@ -244856,6 +244856,25 @@ + + + + + + + + + + suggestions = (List) msg.obj; searchBox.handleSuggestions(msg.getData().getString("query"), suggestions); + break; + case AUTO_LOGIN: { + if (mWebViewClient != null) { + String realm = msg.getData().getString("realm"); + String account = msg.getData().getString("account"); + String args = msg.getData().getString("args"); + mWebViewClient.onReceivedLoginRequest(mWebView, realm, + account, args); + } + break; + } } } @@ -1051,6 +1064,20 @@ class CallbackProxy extends Handler { sendMessage(msg); } + void onReceivedLoginRequest(String realm, String account, String args) { + // Do an unsynchronized quick check to avoid posting if no callback has + // been set. + if (mWebViewClient == null) { + return; + } + Message msg = obtainMessage(AUTO_LOGIN); + Bundle bundle = msg.getData(); + bundle.putString("realm", realm); + bundle.putString("account", account); + bundle.putString("args", args); + sendMessage(msg); + } + //-------------------------------------------------------------------------- // DownloadListener functions. //-------------------------------------------------------------------------- diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java index db605de6dc778..65026a5d02ac1 100644 --- a/core/java/android/webkit/WebViewClient.java +++ b/core/java/android/webkit/WebViewClient.java @@ -256,4 +256,18 @@ public class WebViewClient { */ public void onScaleChanged(WebView view, float oldScale, float newScale) { } + + /** + * Notify the host application that a request to automatically log in the + * user has been processed. + * @param view The WebView requesting the login. + * @param realm The account realm used to look up accounts. + * @param account An optional account. If not null, the account should be + * checked against accounts on the device. If it is a valid + * account, it should be used to log in the user. + * @param args Authenticator specific arguments used to log in the user. + */ + public void onReceivedLoginRequest(WebView view, String realm, + String account, String args) { + } }