Loading core/java/android/webkit/BrowserFrame.java +13 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,17 @@ class BrowserFrame extends Handler { mLoadInitFromJava = false; } /** * Load a url with "POST" method from the network into the main frame. * @param url The url to load. * @param data The data for POST request. */ public void postUrl(String url, byte[] data) { mLoadInitFromJava = true; nativePostUrl(url, data); mLoadInitFromJava = false; } /** * Load the content as if it was loaded by the provided base URL. The * failUrl is used as the history entry for the load data. If null or Loading Loading @@ -754,6 +765,8 @@ class BrowserFrame extends Handler { */ private native void nativeLoadUrl(String url); private native void nativePostUrl(String url, byte[] postData); private native void nativeLoadData(String baseUrl, String data, String mimeType, String encoding, String failUrl); Loading core/java/android/webkit/WebView.java +23 −0 Original line number Diff line number Diff line Loading @@ -1215,6 +1215,29 @@ public class WebView extends AbsoluteLayout clearTextEntry(); } /** * Load the url with postData using "POST" method into the WebView. If url * is not a network url, it will be loaded with {link * {@link #loadUrl(String)} instead. * * @param url The url of the resource to load. * @param postData The data will be passed to "POST" request. * * @hide pending API solidification */ public void postUrl(String url, byte[] postData) { if (URLUtil.isNetworkUrl(url)) { switchOutDrawHistory(); HashMap arg = new HashMap(); arg.put("url", url); arg.put("data", postData); mWebViewCore.sendMessage(EventHub.POST_URL, arg); clearTextEntry(); } else { loadUrl(url); } } /** * Load the given data into the WebView. This will load the data into * WebView using the data: scheme. Content loaded through this mechanism Loading core/java/android/webkit/WebViewCore.java +9 −1 Original line number Diff line number Diff line Loading @@ -580,7 +580,7 @@ final class WebViewCore { "GET_SELECTION", // = 129; "WEBKIT_DRAW", // = 130; "SYNC_SCROLL", // = 131; "", // = 132; "POST_URL", // = 132; "SPLIT_PICTURE_SET", // = 133; "CLEAR_CONTENT", // = 134; "SET_FINAL_FOCUS", // = 135; Loading Loading @@ -627,6 +627,7 @@ final class WebViewCore { static final int GET_SELECTION = 129; static final int WEBKIT_DRAW = 130; static final int SYNC_SCROLL = 131; static final int POST_URL = 132; static final int SPLIT_PICTURE_SET = 133; static final int CLEAR_CONTENT = 134; Loading Loading @@ -714,6 +715,13 @@ final class WebViewCore { loadUrl((String) msg.obj); break; case POST_URL: { HashMap param = (HashMap) msg.obj; String url = (String) param.get("url"); byte[] data = (byte[]) param.get("data"); mBrowserFrame.postUrl(url, data); break; } case LOAD_DATA: HashMap loadParams = (HashMap) msg.obj; String baseUrl = (String) loadParams.get("baseUrl"); Loading Loading
core/java/android/webkit/BrowserFrame.java +13 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,17 @@ class BrowserFrame extends Handler { mLoadInitFromJava = false; } /** * Load a url with "POST" method from the network into the main frame. * @param url The url to load. * @param data The data for POST request. */ public void postUrl(String url, byte[] data) { mLoadInitFromJava = true; nativePostUrl(url, data); mLoadInitFromJava = false; } /** * Load the content as if it was loaded by the provided base URL. The * failUrl is used as the history entry for the load data. If null or Loading Loading @@ -754,6 +765,8 @@ class BrowserFrame extends Handler { */ private native void nativeLoadUrl(String url); private native void nativePostUrl(String url, byte[] postData); private native void nativeLoadData(String baseUrl, String data, String mimeType, String encoding, String failUrl); Loading
core/java/android/webkit/WebView.java +23 −0 Original line number Diff line number Diff line Loading @@ -1215,6 +1215,29 @@ public class WebView extends AbsoluteLayout clearTextEntry(); } /** * Load the url with postData using "POST" method into the WebView. If url * is not a network url, it will be loaded with {link * {@link #loadUrl(String)} instead. * * @param url The url of the resource to load. * @param postData The data will be passed to "POST" request. * * @hide pending API solidification */ public void postUrl(String url, byte[] postData) { if (URLUtil.isNetworkUrl(url)) { switchOutDrawHistory(); HashMap arg = new HashMap(); arg.put("url", url); arg.put("data", postData); mWebViewCore.sendMessage(EventHub.POST_URL, arg); clearTextEntry(); } else { loadUrl(url); } } /** * Load the given data into the WebView. This will load the data into * WebView using the data: scheme. Content loaded through this mechanism Loading
core/java/android/webkit/WebViewCore.java +9 −1 Original line number Diff line number Diff line Loading @@ -580,7 +580,7 @@ final class WebViewCore { "GET_SELECTION", // = 129; "WEBKIT_DRAW", // = 130; "SYNC_SCROLL", // = 131; "", // = 132; "POST_URL", // = 132; "SPLIT_PICTURE_SET", // = 133; "CLEAR_CONTENT", // = 134; "SET_FINAL_FOCUS", // = 135; Loading Loading @@ -627,6 +627,7 @@ final class WebViewCore { static final int GET_SELECTION = 129; static final int WEBKIT_DRAW = 130; static final int SYNC_SCROLL = 131; static final int POST_URL = 132; static final int SPLIT_PICTURE_SET = 133; static final int CLEAR_CONTENT = 134; Loading Loading @@ -714,6 +715,13 @@ final class WebViewCore { loadUrl((String) msg.obj); break; case POST_URL: { HashMap param = (HashMap) msg.obj; String url = (String) param.get("url"); byte[] data = (byte[]) param.get("data"); mBrowserFrame.postUrl(url, data); break; } case LOAD_DATA: HashMap loadParams = (HashMap) msg.obj; String baseUrl = (String) loadParams.get("baseUrl"); Loading