From d0d9bc2f2fe737d186c0cc8c29a325e4f2907e8e Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Tue, 26 Jan 2010 18:08:28 -0800 Subject: Add request header support for the Browser/WebView. QSB can use this instead of POST to send the location data. After QSB makes the switch, we should also remove the POST_DATA intent which is hidden. Add loadUrl(String url, HashMap extraHeaders) to WebView so that the caller can send the extra http headers. Remove "inline:" as no one is using it and it is a hidden feature. Part 1 of 3-project checkin. --- core/java/android/webkit/BrowserFrame.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'core/java/android/webkit/BrowserFrame.java') diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java index 1337beda7038..3f1672af29bf 100644 --- a/core/java/android/webkit/BrowserFrame.java +++ b/core/java/android/webkit/BrowserFrame.java @@ -177,18 +177,21 @@ class BrowserFrame extends Handler { /** * Load a url from the network or the filesystem into the main frame. - * Following the same behaviour as Safari, javascript: URLs are not - * passed to the main frame, instead they are evaluated immediately. + * Following the same behaviour as Safari, javascript: URLs are not passed + * to the main frame, instead they are evaluated immediately. * @param url The url to load. + * @param extraHeaders The extra headers sent with this url. This should not + * include the common headers like "user-agent". If it does, it + * will be replaced by the intrinsic value of the WebView. */ - public void loadUrl(String url) { + public void loadUrl(String url, Map extraHeaders) { mLoadInitFromJava = true; if (URLUtil.isJavaScriptUrl(url)) { // strip off the scheme and evaluate the string stringByEvaluatingJavaScriptFromString( url.substring("javascript:".length())); } else { - nativeLoadUrl(url); + nativeLoadUrl(url, extraHeaders); } mLoadInitFromJava = false; } @@ -904,7 +907,7 @@ class BrowserFrame extends Handler { /** * Returns false if the url is bad. */ - private native void nativeLoadUrl(String url); + private native void nativeLoadUrl(String url, Map headers); private native void nativePostUrl(String url, byte[] postData); -- cgit v1.2.3