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

Side by Side Diff: android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java

Issue 876413007: [Android WebView] Rename ShouldInterceptRequestParams -> AwWebResourceRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed glue code Created 5 years, 10 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
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContents.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 com.android.webview.chromium; 5 package com.android.webview.chromium;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.ActivityNotFoundException; 8 import android.content.ActivityNotFoundException;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 if (mWebChromeClient != null) { 278 if (mWebChromeClient != null) {
279 if (TRACE) Log.d(TAG, "onProgressChanged=" + progress); 279 if (TRACE) Log.d(TAG, "onProgressChanged=" + progress);
280 mWebChromeClient.onProgressChanged(mWebView, progress); 280 mWebChromeClient.onProgressChanged(mWebView, progress);
281 } 281 }
282 } finally { 282 } finally {
283 TraceEvent.end("WebViewContentsClientAdapter.onProgressChanged"); 283 TraceEvent.end("WebViewContentsClientAdapter.onProgressChanged");
284 } 284 }
285 } 285 }
286 286
287 private static class WebResourceRequestImpl implements WebResourceRequest { 287 private static class WebResourceRequestImpl implements WebResourceRequest {
288 private final ShouldInterceptRequestParams mParams; 288 private final AwWebResourceRequest mRequest;
289 289
290 public WebResourceRequestImpl(ShouldInterceptRequestParams params) { 290 public WebResourceRequestImpl(AwWebResourceRequest request) {
291 mParams = params; 291 mRequest = request;
292 } 292 }
293 293
294 @Override 294 @Override
295 public Uri getUrl() { 295 public Uri getUrl() {
296 return Uri.parse(mParams.url); 296 return Uri.parse(mRequest.url);
297 } 297 }
298 298
299 @Override 299 @Override
300 public boolean isForMainFrame() { 300 public boolean isForMainFrame() {
301 return mParams.isMainFrame; 301 return mRequest.isMainFrame;
302 } 302 }
303 303
304 @Override 304 @Override
305 public boolean hasGesture() { 305 public boolean hasGesture() {
306 return mParams.hasUserGesture; 306 return mRequest.hasUserGesture;
307 } 307 }
308 308
309 @Override 309 @Override
310 public String getMethod() { 310 public String getMethod() {
311 return mParams.method; 311 return mRequest.method;
312 } 312 }
313 313
314 @Override 314 @Override
315 public Map<String, String> getRequestHeaders() { 315 public Map<String, String> getRequestHeaders() {
316 return mParams.requestHeaders; 316 return mRequest.requestHeaders;
317 } 317 }
318 } 318 }
319 319
320 /** 320 /**
321 * @see AwContentsClient#shouldInterceptRequest(java.lang.String) 321 * @see AwContentsClient#shouldInterceptRequest(java.lang.String)
322 */ 322 */
323 @Override 323 @Override
324 public AwWebResourceResponse shouldInterceptRequest(ShouldInterceptRequestPa rams params) { 324 public AwWebResourceResponse shouldInterceptRequest(AwWebResourceRequest req uest) {
325 try { 325 try {
326 TraceEvent.begin("WebViewContentsClientAdapter.shouldInterceptReques t"); 326 TraceEvent.begin("WebViewContentsClientAdapter.shouldInterceptReques t");
327 if (TRACE) Log.d(TAG, "shouldInterceptRequest=" + params.url); 327 if (TRACE) Log.d(TAG, "shouldInterceptRequest=" + request.url);
328 WebResourceResponse response = mWebViewClient.shouldInterceptRequest (mWebView, 328 WebResourceResponse response = mWebViewClient.shouldInterceptRequest (mWebView,
329 new WebResourceRequestImpl(params)); 329 new WebResourceRequestImpl(request));
330 if (response == null) return null; 330 if (response == null) return null;
331 331
332 // AwWebResourceResponse should support null headers. b/16332774. 332 // AwWebResourceResponse should support null headers. b/16332774.
333 Map<String, String> responseHeaders = response.getResponseHeaders(); 333 Map<String, String> responseHeaders = response.getResponseHeaders();
334 if (responseHeaders == null) responseHeaders = new HashMap<String, S tring>(); 334 if (responseHeaders == null) responseHeaders = new HashMap<String, S tring>();
335 335
336 return new AwWebResourceResponse( 336 return new AwWebResourceResponse(
337 response.getMimeType(), 337 response.getMimeType(),
338 response.getEncoding(), 338 response.getEncoding(),
339 response.getData(), 339 response.getData(),
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 else 1248 else
1249 mAwPermissionRequest.deny(); 1249 mAwPermissionRequest.deny();
1250 } 1250 }
1251 1251
1252 @Override 1252 @Override
1253 public void deny() { 1253 public void deny() {
1254 mAwPermissionRequest.deny(); 1254 mAwPermissionRequest.deny();
1255 } 1255 }
1256 } 1256 }
1257 } 1257 }
OLDNEW
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContents.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698