@@ -452,10 +452,16 @@ public void handleMessage(Message msg) {
452452 String contentDisposition =
453453 msg .getData ().getString ("contentDisposition" );
454454 String mimetype = msg .getData ().getString ("mimetype" );
455+ String referer = msg .getData ().getString ("referer" );
455456 Long contentLength = msg .getData ().getLong ("contentLength" );
456457
457- mDownloadListener .onDownloadStart (url , userAgent ,
458- contentDisposition , mimetype , contentLength );
458+ if (mDownloadListener instanceof BrowserDownloadListener ) {
459+ ((BrowserDownloadListener ) mDownloadListener ).onDownloadStart (url ,
460+ userAgent , contentDisposition , mimetype , referer , contentLength );
461+ } else {
462+ mDownloadListener .onDownloadStart (url , userAgent ,
463+ contentDisposition , mimetype , contentLength );
464+ }
459465 }
460466 break ;
461467
@@ -1179,7 +1185,8 @@ void onReceivedLoginRequest(String realm, String account, String args) {
11791185 * return false.
11801186 */
11811187 public boolean onDownloadStart (String url , String userAgent ,
1182- String contentDisposition , String mimetype , long contentLength ) {
1188+ String contentDisposition , String mimetype , String referer ,
1189+ long contentLength ) {
11831190 // Do an unsynchronized quick check to avoid posting if no callback has
11841191 // been set.
11851192 if (mDownloadListener == null ) {
@@ -1192,6 +1199,7 @@ public boolean onDownloadStart(String url, String userAgent,
11921199 bundle .putString ("url" , url );
11931200 bundle .putString ("userAgent" , userAgent );
11941201 bundle .putString ("mimetype" , mimetype );
1202+ bundle .putString ("referer" , referer );
11951203 bundle .putLong ("contentLength" , contentLength );
11961204 bundle .putString ("contentDisposition" , contentDisposition );
11971205 sendMessage (msg );
0 commit comments