This source file includes following definitions.
- GetLoadErrorPageContent
- GetNoDomainPageContent
- GetDefaultTextEncoding
- RegisterAwResource
#include "android_webview/native/aw_resource.h"
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "jni/AwResource_jni.h"
namespace android_webview {
namespace AwResource {
std::string GetLoadErrorPageContent() {
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jstring> content =
Java_AwResource_getLoadErrorPageContent(env);
return base::android::ConvertJavaStringToUTF8(content);
}
std::string GetNoDomainPageContent() {
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jstring> content =
Java_AwResource_getNoDomainPageContent(env);
return base::android::ConvertJavaStringToUTF8(content);
}
std::string GetDefaultTextEncoding() {
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jstring> encoding =
Java_AwResource_getDefaultTextEncoding(env);
return base::android::ConvertJavaStringToUTF8(encoding);
}
bool RegisterAwResource(JNIEnv* env) {
return RegisterNativesImpl(env) >= 0;
}
}
}