128c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine/*
228c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine * Copyright (C) 2016 The Android Open Source Project
328c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine *
428c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine * Licensed under the Apache License, Version 2.0 (the "License");
528c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine * you may not use this file except in compliance with the License.
628c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine * You may obtain a copy of the License at
728c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine *
828c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine *      http://www.apache.org/licenses/LICENSE-2.0
928c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine *
1028c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine * Unless required by applicable law or agreed to in writing, software
1128c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine * distributed under the License is distributed on an "AS IS" BASIS,
1228c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1328c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine * See the License for the specific language governing permissions and
1428c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine * limitations under the License.
1528c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine */
1628c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine
1728c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodinepackage android.webkit;
1828c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine
19b90f5389ddd704bb50bb7846ff3298920e7bb40aTim Volodine/**
20b90f5389ddd704bb50bb7846ff3298920e7bb40aTim Volodine * Base class for clients to capture Service Worker related callbacks,
21b90f5389ddd704bb50bb7846ff3298920e7bb40aTim Volodine * see {@link ServiceWorkerController} for usage example.
22b90f5389ddd704bb50bb7846ff3298920e7bb40aTim Volodine */
2328c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodinepublic class ServiceWorkerClient {
2428c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine
2528c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine    /**
2628c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     * Notify the host application of a resource request and allow the
2728c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     * application to return the data. If the return value is null, the
2828c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     * Service Worker will continue to load the resource as usual.
2928c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     * Otherwise, the return response and data will be used.
3028c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     * NOTE: This method is called on a thread other than the UI thread
3128c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     * so clients should exercise caution when accessing private data
3228c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     * or the view system.
3328c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     *
3428c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     * @param request Object containing the details of the request.
3528c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     * @return A {@link android.webkit.WebResourceResponse} containing the
3628c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     *         response information or null if the WebView should load the
3728c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     *         resource itself.
38b90f5389ddd704bb50bb7846ff3298920e7bb40aTim Volodine     * @see WebViewClient#shouldInterceptRequest(WebView, WebResourceRequest)
3928c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine     */
4028c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine    public WebResourceResponse shouldInterceptRequest(WebResourceRequest request) {
4128c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine        return null;
4228c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine    }
4328c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine}
4428c83564419de9f4f3d22aff630244dc4cbc3c2fTim Volodine
45