From c6a90a59b342114d760d899e09d8def672b49ca8 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Thu, 25 Mar 2010 15:38:04 +0000 Subject: Provides ability to store HTTP authentication credentials supplied to an XHR from JavaScript This change forwards to the WebViewClient HTTP authentication credentials that are supplied to an XHR from JavaScript. This allows the client to store these credentials for use with later requests. Currently, the browser only stores credentials that have been entered manually by the user through the authentication dialog. Bug: 2544330 Change-Id: I913e35d80b7ad41ff75586092408b86ea9f543d8 --- core/java/android/webkit/WebViewClient.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'core/java/android/webkit/WebViewClient.java') diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java index 02c721009b10..4ac660e68513 100644 --- a/core/java/android/webkit/WebViewClient.java +++ b/core/java/android/webkit/WebViewClient.java @@ -196,6 +196,22 @@ public class WebViewClient { handler.cancel(); } + /** + * Notify the host application that authentication credentials have been + * supplied from Script. + * The default behavior is to do nothing. + * @hide Pending API council review + * + * @param view The WebView that is initiating the callback. + * @param host The host requiring authentication. + * @param realm A description to help store user credentials for future + * @param username The username + * @param password The password + */ + public void onReceivedHttpAuthCredentials(WebView view, String host, + String realm, String username, String password) { + } + /** * Give the host application a chance to handle the key event synchronously. * e.g. menu shortcut key events need to be filtered this way. If return -- cgit v1.2.3