OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 package org.chromium.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 | 8 |
9 /** | 9 /** |
10 * Manages clients and settings for Service Workers. | 10 * Manages clients and settings for Service Workers. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 public boolean shouldBlockNetworkLoads() { | 74 public boolean shouldBlockNetworkLoads() { |
75 return mServiceWorkerSettings.getBlockNetworkLoads(); | 75 return mServiceWorkerSettings.getBlockNetworkLoads(); |
76 } | 76 } |
77 | 77 |
78 @Override | 78 @Override |
79 public boolean shouldAcceptThirdPartyCookies() { | 79 public boolean shouldAcceptThirdPartyCookies() { |
80 // We currently don't allow third party cookies in service workers, | 80 // We currently don't allow third party cookies in service workers, |
81 // see e.g. AwCookieAccessPolicy::GetShouldAcceptThirdPartyCookies. | 81 // see e.g. AwCookieAccessPolicy::GetShouldAcceptThirdPartyCookies. |
82 return false; | 82 return false; |
83 } | 83 } |
| 84 |
| 85 @Override |
| 86 public boolean getSafeBrowsingEnabled() { |
| 87 return AwContentsStatics.getSafeBrowsingEnabled(); |
| 88 } |
84 } | 89 } |
85 | 90 |
86 private class ServiceWorkerBackgroundThreadClientImpl | 91 private class ServiceWorkerBackgroundThreadClientImpl |
87 extends AwContentsBackgroundThreadClient { | 92 extends AwContentsBackgroundThreadClient { |
88 // All methods are called on the background thread. | 93 // All methods are called on the background thread. |
89 @Override | 94 @Override |
90 public AwWebResourceResponse shouldInterceptRequest( | 95 public AwWebResourceResponse shouldInterceptRequest( |
91 AwContentsClient.AwWebResourceRequest request) { | 96 AwContentsClient.AwWebResourceRequest request) { |
92 // TODO: Consider analogy with AwContentsClient, i.e. | 97 // TODO: Consider analogy with AwContentsClient, i.e. |
93 // - do we need an onloadresource callback? | 98 // - do we need an onloadresource callback? |
94 // - do we need to post an error if the response data == null? | 99 // - do we need to post an error if the response data == null? |
95 return mServiceWorkerClient.shouldInterceptRequest(request); | 100 return mServiceWorkerClient.shouldInterceptRequest(request); |
96 } | 101 } |
97 } | 102 } |
98 } | 103 } |
OLD | NEW |