• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 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 #ifndef ANDROID_WEBVIEW_NATIVE_ANDROID_PROTOCOL_HANDLER_H_
6 #define ANDROID_WEBVIEW_NATIVE_ANDROID_PROTOCOL_HANDLER_H_
7 
8 #include "base/android/jni_android.h"
9 #include "base/memory/scoped_ptr.h"
10 
11 namespace net {
12 class URLRequestContext;
13 class URLRequestInterceptor;
14 }  // namespace net
15 
16 namespace android_webview {
17 
18 // These methods create interceptors for Android WebView-specific schemes:
19 //
20 //  - "content:" scheme is used for accessing data from Android content
21 //    providers, see http://developer.android.com/guide/topics/providers/
22 //      content-provider-basics.html#ContentURIs
23 scoped_ptr<net::URLRequestInterceptor> CreateContentSchemeRequestInterceptor();
24 
25 //  - "file:" scheme extension for accessing application assets and resources
26 //    (file:///android_asset/ and file:///android_res/), see
27 //    http://developer.android.com/reference/android/webkit/
28 //      WebSettings.html#setAllowFileAccess(boolean)
29 scoped_ptr<net::URLRequestInterceptor> CreateAssetFileRequestInterceptor();
30 
31 bool RegisterAndroidProtocolHandler(JNIEnv* env);
32 
33 }  // namespace android_webview
34 
35 #endif  // ANDROID_WEBVIEW_NATIVE_ANDROID_PROTOCOL_HANDLER_H_
36