android_protocol_handler.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
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
10namespace net {
11class URLRequestContext;
12class URLRequestJobFactory;
13}  // namespace net
14
15namespace android_webview {
16
17// This class adds support for Android WebView-specific protocol schemes:
18//
19//  - "content:" scheme is used for accessing data from Android content
20//    providers, see http://developer.android.com/guide/topics/providers/
21//      content-provider-basics.html#ContentURIs
22//
23//  - "file:" scheme extension for accessing application assets and resources
24//    (file:///android_asset/ and file:///android_res/), see
25//    http://developer.android.com/reference/android/webkit/
26//      WebSettings.html#setAllowFileAccess(boolean)
27void RegisterAndroidProtocolsOnIOThread(
28    net::URLRequestContext* context,
29    net::URLRequestJobFactory* job_factory);
30
31bool RegisterAndroidProtocolHandler(JNIEnv* env);
32}  // namespace android_webview
33
34#endif  // ANDROID_WEBVIEW_NATIVE_ANDROID_PROTOCOL_HANDLER_H_
35