Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/AwContentsIoThreadClient.java

Issue 976403003: Make shouldInterceptRequest thinner in glue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698