This source file includes following definitions.
- JNINamespace
- onNativeContentSettingsDestroyed
- getJavaScriptEnabled
- nativeInit
- nativeGetJavaScriptEnabled
package org.chromium.content.browser;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
import org.chromium.base.ThreadUtils;
@JNINamespace("content")
public class ContentSettings {
private static final String TAG = "ContentSettings";
private long mNativeContentSettings = 0;
private ContentViewCore mContentViewCore;
ContentSettings(ContentViewCore contentViewCore, long nativeContentView) {
ThreadUtils.assertOnUiThread();
mContentViewCore = contentViewCore;
mNativeContentSettings = nativeInit(nativeContentView);
assert mNativeContentSettings != 0;
}
@CalledByNative
private void onNativeContentSettingsDestroyed(long nativeContentSettings) {
assert mNativeContentSettings == nativeContentSettings;
mNativeContentSettings = 0;
}
public boolean getJavaScriptEnabled() {
ThreadUtils.assertOnUiThread();
return mNativeContentSettings != 0 ?
nativeGetJavaScriptEnabled(mNativeContentSettings) : false;
}
private native long nativeInit(long contentViewPtr);
private native boolean nativeGetJavaScriptEnabled(long nativeContentSettings);
}