| 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 CHROME_BROWSER_ANDROID_ANDROID_PROTOCOL_ADAPTER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_ANDROID_PROTOCOL_ADAPTER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_ANDROID_PROTOCOL_ADAPTER_H_ | 6 #define CHROME_BROWSER_ANDROID_ANDROID_PROTOCOL_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "net/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
| 11 | 11 |
| 12 namespace net { |
| 13 |
| 14 class URLRequestContextGetter; |
| 15 |
| 16 } |
| 17 |
| 18 // This class adds support for Android WebView-specific protocol 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 // |
| 24 // - "file:" scheme extension for accessing application assets and resources |
| 25 // (file:///android_asset/ and file:///android_res/), see |
| 26 // http://developer.android.com/reference/android/webkit/ |
| 27 // WebSettings.html#setAllowFileAccess(boolean) |
| 28 // |
| 12 class AndroidProtocolAdapter { | 29 class AndroidProtocolAdapter { |
| 13 public: | 30 public: |
| 14 static net::URLRequest::ProtocolFactory Factory; | 31 static net::URLRequest::ProtocolFactory Factory; |
| 15 | 32 |
| 16 // Register the protocol factories for all supported Android protocol | 33 // Register handlers for all supported Android protocol schemes. |
| 17 // schemes. | 34 static void RegisterProtocols( |
| 18 static bool RegisterProtocols(JNIEnv* env); | 35 JNIEnv* env, net::URLRequestContextGetter* context_getter); |
| 19 | 36 |
| 20 private: | 37 private: |
| 21 DISALLOW_IMPLICIT_CONSTRUCTORS(AndroidProtocolAdapter); | 38 DISALLOW_IMPLICIT_CONSTRUCTORS(AndroidProtocolAdapter); |
| 22 }; | 39 }; |
| 23 | 40 |
| 24 #endif // CHROME_BROWSER_ANDROID_ANDROID_PROTOCOL_ADAPTER_H_ | 41 #endif // CHROME_BROWSER_ANDROID_ANDROID_PROTOCOL_ADAPTER_H_ |
| OLD | NEW |