15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef ANDROID_WEBVIEW_NATIVE_ANDROID_PROTOCOL_HANDLER_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define ANDROID_WEBVIEW_NATIVE_ANDROID_PROTOCOL_HANDLER_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/android/jni_android.h"
92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/memory/scoped_ptr.h"
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace net {
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class URLRequestContext;
13cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)class URLRequestInterceptor;
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace net
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace android_webview {
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
18cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// These methods create interceptors for Android WebView-specific schemes:
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  - "content:" scheme is used for accessing data from Android content
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//    providers, see http://developer.android.com/guide/topics/providers/
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//      content-provider-basics.html#ContentURIs
23cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)scoped_ptr<net::URLRequestInterceptor> CreateContentSchemeRequestInterceptor();
242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//  - "file:" scheme extension for accessing application assets and resources
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//    (file:///android_asset/ and file:///android_res/), see
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//    http://developer.android.com/reference/android/webkit/
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//      WebSettings.html#setAllowFileAccess(boolean)
29cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)scoped_ptr<net::URLRequestInterceptor> CreateAssetFileRequestInterceptor();
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)bool RegisterAndroidProtocolHandler(JNIEnv* env);
322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace android_webview
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // ANDROID_WEBVIEW_NATIVE_ANDROID_PROTOCOL_HANDLER_H_
36