OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import org.chromium.base.CalledByNative; | 7 import org.chromium.base.CalledByNative; |
8 import org.chromium.base.JNINamespace; | 8 import org.chromium.base.JNINamespace; |
9 | 9 |
10 import java.util.HashMap; | 10 import java.util.HashMap; |
(...skipping 22 matching lines...) Expand all Loading... |
33 public abstract boolean shouldAcceptThirdPartyCookies(); | 33 public abstract boolean shouldAcceptThirdPartyCookies(); |
34 | 34 |
35 @CalledByNative | 35 @CalledByNative |
36 public abstract void onDownloadStart(String url, String userAgent, | 36 public abstract void onDownloadStart(String url, String userAgent, |
37 String contentDisposition, String mimeType, long contentLength); | 37 String contentDisposition, String mimeType, long contentLength); |
38 | 38 |
39 @CalledByNative | 39 @CalledByNative |
40 public abstract void newLoginRequest(String realm, String account, String ar
gs); | 40 public abstract void newLoginRequest(String realm, String account, String ar
gs); |
41 | 41 |
42 public abstract AwWebResourceResponse shouldInterceptRequest( | 42 public abstract AwWebResourceResponse shouldInterceptRequest( |
43 AwContentsClient.AwWebResourceRequest request); | 43 AwContentsClient.WebResourceRequestImpl request); |
44 | 44 |
45 // Protected methods -------------------------------------------------------
-------------------- | 45 // Protected methods -------------------------------------------------------
-------------------- |
46 | 46 |
47 @CalledByNative | 47 @CalledByNative |
48 protected AwWebResourceResponse shouldInterceptRequest(String url, boolean i
sMainFrame, | 48 protected AwWebResourceResponse shouldInterceptRequest(String url, boolean i
sMainFrame, |
49 boolean hasUserGesture, String method, String[] requestHeaderNames, | 49 boolean hasUserGesture, String method, String[] requestHeaderNames, |
50 String[] requestHeaderValues) { | 50 String[] requestHeaderValues) { |
51 AwContentsClient.AwWebResourceRequest request = | 51 HashMap<String, String> requestHeaders = |
52 new AwContentsClient.AwWebResourceRequest(); | 52 new HashMap<String, String>(requestHeaderNames.length); |
53 request.url = url; | |
54 request.isMainFrame = isMainFrame; | |
55 request.hasUserGesture = hasUserGesture; | |
56 request.method = method; | |
57 request.requestHeaders = new HashMap<String, String>(requestHeaderNames.
length); | |
58 for (int i = 0; i < requestHeaderNames.length; ++i) { | 53 for (int i = 0; i < requestHeaderNames.length; ++i) { |
59 request.requestHeaders.put(requestHeaderNames[i], requestHeaderValue
s[i]); | 54 requestHeaders.put(requestHeaderNames[i], requestHeaderValues[i]); |
60 } | 55 } |
| 56 |
| 57 AwContentsClient.WebResourceRequestImpl request = |
| 58 new AwContentsClient.WebResourceRequestImpl( |
| 59 url, isMainFrame, hasUserGesture, method, requestHeaders
); |
61 return shouldInterceptRequest(request); | 60 return shouldInterceptRequest(request); |
62 } | 61 } |
63 } | 62 } |
OLD | NEW |