diff options
author | Iain Merrick <husky@google.com> | 2010-10-18 18:22:25 +0100 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-10-20 15:55:12 +0100 |
commit | d77f9b7b3901a93521068ffda53200d3a4233de7 (patch) | |
tree | 5b05dc4b54df87754155dea13b102a1ca8a2402e /core/java/android/webkit/BrowserFrame.java | |
parent | 5ff9980ac510a996927398a803f2bab3b71c7ebf (diff) | |
download | frameworks_base-d77f9b7b3901a93521068ffda53200d3a4233de7.zip frameworks_base-d77f9b7b3901a93521068ffda53200d3a4233de7.tar.gz frameworks_base-d77f9b7b3901a93521068ffda53200d3a4233de7.tar.bz2 |
Implement file downloads for Chrome HTTP stack (Java side)
This just adds an extra entrypoint to BrowserFrame. It delegates
directly to the identical method in CallbackProxy, and from there
downloads are handled in the same way as before.
See matching C++ change in external/webkit (I81300400)
Change-Id: I87e71debe475d0d24e13a5763fbe803e3cd78cf5
Diffstat (limited to 'core/java/android/webkit/BrowserFrame.java')
-rw-r--r-- | core/java/android/webkit/BrowserFrame.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java index ad5765b..6e588b9 100644 --- a/core/java/android/webkit/BrowserFrame.java +++ b/core/java/android/webkit/BrowserFrame.java @@ -1079,6 +1079,20 @@ class BrowserFrame extends Handler { mCallbackProxy.onReceivedHttpAuthRequest(handler, host, realm); } + /** + * Called by JNI when the native HTTP stack needs to download a file. + * + * We delegate the request to CallbackProxy, which owns the current app's + * DownloadListener. + */ + private void downloadStart(String url, String userAgent, + String contentDisposition, String mimeType, long contentLength) { + mimeType = MimeTypeMap.getSingleton().remapGenericMimeType( + mimeType, url, contentDisposition); + mCallbackProxy.onDownloadStart(url, userAgent, + contentDisposition, mimeType, contentLength); + } + //========================================================================== // native functions //========================================================================== |