summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit/BrowserFrame.java
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2010-01-26 18:08:28 -0800
committerGrace Kloba <klobag@google.com>2010-01-27 12:28:11 -0800
commitd0d9bc2f2fe737d186c0cc8c29a325e4f2907e8e (patch)
treef2cf97810b503211f57c972fb0db36d94e195703 /core/java/android/webkit/BrowserFrame.java
parent946e007283d76d6855824ed00910fb1470d369c2 (diff)
downloadframeworks_base-d0d9bc2f2fe737d186c0cc8c29a325e4f2907e8e.zip
frameworks_base-d0d9bc2f2fe737d186c0cc8c29a325e4f2907e8e.tar.gz
frameworks_base-d0d9bc2f2fe737d186c0cc8c29a325e4f2907e8e.tar.bz2
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.
Diffstat (limited to 'core/java/android/webkit/BrowserFrame.java')
-rw-r--r--core/java/android/webkit/BrowserFrame.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java
index 1337bed..3f1672a 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<String, String> 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<String, String> headers);
private native void nativePostUrl(String url, byte[] postData);