OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.chrome.browser.superviseduser; | 5 package org.chromium.chrome.browser.superviseduser; |
6 | 6 |
7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
8 import android.content.BroadcastReceiver; | 8 import android.content.BroadcastReceiver; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 15 matching lines...) Expand all Loading... |
26 import java.util.concurrent.ArrayBlockingQueue; | 26 import java.util.concurrent.ArrayBlockingQueue; |
27 import java.util.concurrent.BlockingQueue; | 27 import java.util.concurrent.BlockingQueue; |
28 import java.util.concurrent.TimeUnit; | 28 import java.util.concurrent.TimeUnit; |
29 | 29 |
30 /** | 30 /** |
31 * Content provider for telling other apps (e.g. WebView apps) about the supervi
sed user URL filter. | 31 * Content provider for telling other apps (e.g. WebView apps) about the supervi
sed user URL filter. |
32 */ | 32 */ |
33 public class SupervisedUserContentProvider extends WebRestrictionsContentProvide
r { | 33 public class SupervisedUserContentProvider extends WebRestrictionsContentProvide
r { |
34 private static final String SUPERVISED_USER_CONTENT_PROVIDER_ENABLED = | 34 private static final String SUPERVISED_USER_CONTENT_PROVIDER_ENABLED = |
35 "SupervisedUserContentProviderEnabled"; | 35 "SupervisedUserContentProviderEnabled"; |
36 private long mNativeSupervisedUserContentProvider = 0; | 36 private long mNativeSupervisedUserContentProvider; |
37 private boolean mChromeAlreadyStarted; | 37 private boolean mChromeAlreadyStarted; |
38 private static Object sEnabledLock = new Object(); | 38 private static Object sEnabledLock = new Object(); |
39 | 39 |
40 // Three value "boolean" caching enabled state, null if not yet known. | 40 // Three value "boolean" caching enabled state, null if not yet known. |
41 private static Boolean sEnabled = null; | 41 private static Boolean sEnabled; |
42 | 42 |
43 private long getSupervisedUserContentProvider() throws ProcessInitException
{ | 43 private long getSupervisedUserContentProvider() throws ProcessInitException
{ |
44 mChromeAlreadyStarted = LibraryLoader.isInitialized(); | 44 mChromeAlreadyStarted = LibraryLoader.isInitialized(); |
45 if (mNativeSupervisedUserContentProvider != 0) { | 45 if (mNativeSupervisedUserContentProvider != 0) { |
46 return mNativeSupervisedUserContentProvider; | 46 return mNativeSupervisedUserContentProvider; |
47 } | 47 } |
48 | 48 |
49 ChromeBrowserInitializer.getInstance(getContext()).handleSynchronousStar
tup(); | 49 ChromeBrowserInitializer.getInstance(getContext()).handleSynchronousStar
tup(); |
50 | 50 |
51 mNativeSupervisedUserContentProvider = nativeCreateSupervisedUserContent
Provider(); | 51 mNativeSupervisedUserContentProvider = nativeCreateSupervisedUserContent
Provider(); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 private native void nativeSetFilterForTesting(long nativeSupervisedUserConte
ntProvider); | 267 private native void nativeSetFilterForTesting(long nativeSupervisedUserConte
ntProvider); |
268 | 268 |
269 @Override | 269 @Override |
270 protected String[] getErrorColumnNames() { | 270 protected String[] getErrorColumnNames() { |
271 String result[] = {"Reason", "Allow access requests", "Is child account"
, | 271 String result[] = {"Reason", "Allow access requests", "Is child account"
, |
272 "Profile image URL", "Second profile image URL", "Custodian", "C
ustodian email", | 272 "Profile image URL", "Second profile image URL", "Custodian", "C
ustodian email", |
273 "Second custodian", "Second custodian email"}; | 273 "Second custodian", "Second custodian email"}; |
274 return result; | 274 return result; |
275 } | 275 } |
276 } | 276 } |
OLD | NEW |