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