OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package com.android.webview.chromium; |
| 6 |
| 7 import android.webkit.ServiceWorkerClient; |
| 8 import android.webkit.ServiceWorkerController; |
| 9 import android.webkit.ServiceWorkerWebSettings; |
| 10 |
| 11 import org.chromium.android_webview.AwServiceWorkerController; |
| 12 |
| 13 /** |
| 14 * Chromium implementation of ServiceWorkerController -- forwards calls to |
| 15 * the chromium internal implementation. |
| 16 */ |
| 17 public class ServiceWorkerControllerAdapter extends ServiceWorkerController { |
| 18 |
| 19 private AwServiceWorkerController mAwServiceWorkerController; |
| 20 |
| 21 public ServiceWorkerControllerAdapter(AwServiceWorkerController controller)
{ |
| 22 mAwServiceWorkerController = controller; |
| 23 } |
| 24 |
| 25 /** |
| 26 * Sets the settings for all service workers. |
| 27 */ |
| 28 @Override |
| 29 public ServiceWorkerWebSettings getServiceWorkerWebSettings() { |
| 30 return new ServiceWorkerSettingsAdapter( |
| 31 mAwServiceWorkerController.getAwServiceWorkerSettings()); |
| 32 } |
| 33 |
| 34 /** |
| 35 * Sets the client to capture service worker related callbacks. |
| 36 */ |
| 37 @Override |
| 38 public void setServiceWorkerClient(ServiceWorkerClient client) { |
| 39 mAwServiceWorkerController.setServiceWorkerClient(new ServiceWorkerClien
tAdapter(client)); |
| 40 } |
| 41 } |
OLD | NEW |