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 3 // found in the LICENSE file. 4 5 package org.chromium.android_webview; 6 7 import org.chromium.base.CalledByNative; 8 import org.chromium.base.JNINamespace; 9 10 /** 11 * Delegate for handling callbacks. All methods are called on the IO thread. 12 * 13 * You should create a separate instance for every WebContents that requires the 14 * provided functionality. 15 */ 16 @JNINamespace("android_webview") 17 public interface AwContentsIoThreadClient { 18 @CalledByNative getCacheMode()19 public int getCacheMode(); 20 21 @CalledByNative shouldInterceptRequest(String url, boolean isMainFrame)22 public InterceptedRequestData shouldInterceptRequest(String url, boolean isMainFrame); 23 24 @CalledByNative shouldBlockContentUrls()25 public boolean shouldBlockContentUrls(); 26 27 @CalledByNative shouldBlockFileUrls()28 public boolean shouldBlockFileUrls(); 29 30 @CalledByNative shouldBlockNetworkLoads()31 public boolean shouldBlockNetworkLoads(); 32 33 @CalledByNative onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength)34 public void onDownloadStart(String url, 35 String userAgent, 36 String contentDisposition, 37 String mimeType, 38 long contentLength); 39 40 @CalledByNative newLoginRequest(String realm, String account, String args)41 public void newLoginRequest(String realm, String account, String args); 42 } 43