mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-16 19:07:17 +01:00
67 lines
2.8 KiB
Java
67 lines
2.8 KiB
Java
package androidx.webkit.internal;
|
|
|
|
import androidx.webkit.Profile;
|
|
import androidx.webkit.ProfileStore;
|
|
import java.lang.reflect.InvocationHandler;
|
|
import java.util.List;
|
|
import org.chromium.support_lib_boundary.ProfileBoundaryInterface;
|
|
import org.chromium.support_lib_boundary.ProfileStoreBoundaryInterface;
|
|
import org.chromium.support_lib_boundary.util.BoundaryInterfaceReflectionUtil;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes14.dex */
|
|
public class ProfileStoreImpl implements ProfileStore {
|
|
private static ProfileStore sInstance;
|
|
private final ProfileStoreBoundaryInterface mProfileStoreImpl;
|
|
|
|
private ProfileStoreImpl() {
|
|
this.mProfileStoreImpl = null;
|
|
}
|
|
|
|
public static ProfileStore getInstance() {
|
|
if (sInstance == null) {
|
|
sInstance = new ProfileStoreImpl(WebViewGlueCommunicator.getFactory().getProfileStore());
|
|
}
|
|
return sInstance;
|
|
}
|
|
|
|
@Override // androidx.webkit.ProfileStore
|
|
public boolean deleteProfile(String str) throws IllegalStateException {
|
|
if (WebViewFeatureInternal.MULTI_PROFILE.isSupportedByWebView()) {
|
|
return this.mProfileStoreImpl.deleteProfile(str);
|
|
}
|
|
throw WebViewFeatureInternal.getUnsupportedOperationException();
|
|
}
|
|
|
|
@Override // androidx.webkit.ProfileStore
|
|
public List<String> getAllProfileNames() {
|
|
if (WebViewFeatureInternal.MULTI_PROFILE.isSupportedByWebView()) {
|
|
return this.mProfileStoreImpl.getAllProfileNames();
|
|
}
|
|
throw WebViewFeatureInternal.getUnsupportedOperationException();
|
|
}
|
|
|
|
@Override // androidx.webkit.ProfileStore
|
|
public Profile getOrCreateProfile(String str) {
|
|
if (WebViewFeatureInternal.MULTI_PROFILE.isSupportedByWebView()) {
|
|
return new ProfileImpl((ProfileBoundaryInterface) BoundaryInterfaceReflectionUtil.castToSuppLibClass(ProfileBoundaryInterface.class, this.mProfileStoreImpl.getOrCreateProfile(str)));
|
|
}
|
|
throw WebViewFeatureInternal.getUnsupportedOperationException();
|
|
}
|
|
|
|
@Override // androidx.webkit.ProfileStore
|
|
public Profile getProfile(String str) {
|
|
if (!WebViewFeatureInternal.MULTI_PROFILE.isSupportedByWebView()) {
|
|
throw WebViewFeatureInternal.getUnsupportedOperationException();
|
|
}
|
|
InvocationHandler profile = this.mProfileStoreImpl.getProfile(str);
|
|
if (profile != null) {
|
|
return new ProfileImpl((ProfileBoundaryInterface) BoundaryInterfaceReflectionUtil.castToSuppLibClass(ProfileBoundaryInterface.class, profile));
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private ProfileStoreImpl(ProfileStoreBoundaryInterface profileStoreBoundaryInterface) {
|
|
this.mProfileStoreImpl = profileStoreBoundaryInterface;
|
|
}
|
|
}
|