Jonathan Dixon | 74fc73f | 2013-10-18 16:51:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.webkit; |
| 18 | |
Nate Fischer | 3442c74 | 2017-09-08 17:02:00 -0700 | [diff] [blame] | 19 | import android.annotation.Nullable; |
Mathew Inwood | 42afea2 | 2018-08-16 19:18:28 +0100 | [diff] [blame] | 20 | import android.annotation.UnsupportedAppUsage; |
Jonathan Dixon | 74fc73f | 2013-10-18 16:51:53 -0700 | [diff] [blame] | 21 | import android.webkit.CacheManager.CacheResult; |
| 22 | import android.webkit.PluginData; |
Nate Fischer | 0a6140d | 2017-09-05 12:37:49 -0700 | [diff] [blame] | 23 | |
Jonathan Dixon | 74fc73f | 2013-10-18 16:51:53 -0700 | [diff] [blame] | 24 | import java.util.Map; |
| 25 | |
| 26 | /** |
| 27 | * @hide |
| 28 | * @deprecated This interface was inteded to be used by Gears. Since Gears was |
| 29 | * deprecated, so is this class. |
| 30 | */ |
| 31 | @Deprecated |
| 32 | public interface UrlInterceptHandler { |
| 33 | |
| 34 | /** |
| 35 | * Given an URL, returns the CacheResult which contains the |
Nate Fischer | 0a6140d | 2017-09-05 12:37:49 -0700 | [diff] [blame] | 36 | * surrogate response for the request, or {@code null} if the handler is |
Jonathan Dixon | 74fc73f | 2013-10-18 16:51:53 -0700 | [diff] [blame] | 37 | * not interested. |
| 38 | * |
| 39 | * @param url URL string. |
Nate Fischer | 3442c74 | 2017-09-08 17:02:00 -0700 | [diff] [blame] | 40 | * @param headers The headers associated with the request. |
Jonathan Dixon | 74fc73f | 2013-10-18 16:51:53 -0700 | [diff] [blame] | 41 | * @return The CacheResult containing the surrogate response. |
| 42 | * |
| 43 | * @hide |
| 44 | * @deprecated Do not use, this interface is deprecated. |
| 45 | */ |
| 46 | @Deprecated |
Nate Fischer | 3442c74 | 2017-09-08 17:02:00 -0700 | [diff] [blame] | 47 | @Nullable |
Mathew Inwood | 42afea2 | 2018-08-16 19:18:28 +0100 | [diff] [blame] | 48 | @UnsupportedAppUsage |
Nate Fischer | 3442c74 | 2017-09-08 17:02:00 -0700 | [diff] [blame] | 49 | CacheResult service(String url, @Nullable Map<String, String> headers); |
Jonathan Dixon | 74fc73f | 2013-10-18 16:51:53 -0700 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * Given an URL, returns the PluginData which contains the |
Nate Fischer | 0a6140d | 2017-09-05 12:37:49 -0700 | [diff] [blame] | 53 | * surrogate response for the request, or {@code null} if the handler is |
Jonathan Dixon | 74fc73f | 2013-10-18 16:51:53 -0700 | [diff] [blame] | 54 | * not interested. |
| 55 | * |
| 56 | * @param url URL string. |
Nate Fischer | 3442c74 | 2017-09-08 17:02:00 -0700 | [diff] [blame] | 57 | * @param headers The headers associated with the request. |
Jonathan Dixon | 74fc73f | 2013-10-18 16:51:53 -0700 | [diff] [blame] | 58 | * @return The PluginData containing the surrogate response. |
| 59 | * |
| 60 | * @hide |
| 61 | * @deprecated Do not use, this interface is deprecated. |
| 62 | */ |
| 63 | @Deprecated |
Nate Fischer | 3442c74 | 2017-09-08 17:02:00 -0700 | [diff] [blame] | 64 | @Nullable |
Mathew Inwood | 42afea2 | 2018-08-16 19:18:28 +0100 | [diff] [blame] | 65 | @UnsupportedAppUsage |
Nate Fischer | 3442c74 | 2017-09-08 17:02:00 -0700 | [diff] [blame] | 66 | PluginData getPluginData(String url, @Nullable Map<String, String> headers); |
Jonathan Dixon | 74fc73f | 2013-10-18 16:51:53 -0700 | [diff] [blame] | 67 | } |