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 org.chromium.android_webview.AwServiceWorkerSettings; |
| 8 import org.chromium.base.annotations.SuppressFBWarnings; |
| 9 |
| 10 /** |
| 11 * Type adaptation layer between {@link android.webkit.ServiceWorkerWebSettings} |
| 12 * and {@link org.chromium.android_webview.AwServiceWorkerSettings}. |
| 13 */ |
| 14 @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") |
| 15 public class ServiceWorkerSettingsAdapter extends android.webkit.ServiceWorkerWe
bSettings { |
| 16 private AwServiceWorkerSettings mAwServiceWorkerSettings; |
| 17 |
| 18 public ServiceWorkerSettingsAdapter(AwServiceWorkerSettings awSettings) { |
| 19 mAwServiceWorkerSettings = awSettings; |
| 20 } |
| 21 |
| 22 AwServiceWorkerSettings getAwSettings() { |
| 23 return mAwServiceWorkerSettings; |
| 24 } |
| 25 |
| 26 @Override |
| 27 public void setAllowFileAccess(boolean allow) { |
| 28 mAwServiceWorkerSettings.setAllowFileAccess(allow); |
| 29 } |
| 30 |
| 31 @Override |
| 32 public boolean getAllowFileAccess() { |
| 33 return mAwServiceWorkerSettings.getAllowFileAccess(); |
| 34 } |
| 35 |
| 36 @Override |
| 37 public void setAllowContentAccess(boolean allow) { |
| 38 mAwServiceWorkerSettings.setAllowContentAccess(allow); |
| 39 } |
| 40 |
| 41 @Override |
| 42 public boolean getAllowContentAccess() { |
| 43 return mAwServiceWorkerSettings.getAllowContentAccess(); |
| 44 } |
| 45 |
| 46 @Override |
| 47 public synchronized void setBlockNetworkLoads(boolean flag) { |
| 48 mAwServiceWorkerSettings.setBlockNetworkLoads(flag); |
| 49 } |
| 50 |
| 51 @Override |
| 52 public synchronized boolean getBlockNetworkLoads() { |
| 53 return mAwServiceWorkerSettings.getBlockNetworkLoads(); |
| 54 } |
| 55 |
| 56 @Override |
| 57 public void setCacheMode(int mode) { |
| 58 mAwServiceWorkerSettings.setCacheMode(mode); |
| 59 } |
| 60 |
| 61 @Override |
| 62 public int getCacheMode() { |
| 63 return mAwServiceWorkerSettings.getCacheMode(); |
| 64 } |
| 65 } |
OLD | NEW |