This source file includes following definitions.
- Register
- LockOrientation
- UnlockOrientation
- CreateProvider
#include "content/browser/screen_orientation/screen_orientation_provider_android.h"
#include "content/browser/screen_orientation/screen_orientation_dispatcher_host.h"
#include "jni/ScreenOrientationProvider_jni.h"
namespace content {
ScreenOrientationProviderAndroid::ScreenOrientationProviderAndroid() {
}
ScreenOrientationProviderAndroid::~ScreenOrientationProviderAndroid() {
}
bool ScreenOrientationProviderAndroid::Register(JNIEnv* env) {
return RegisterNativesImpl(env);
}
void ScreenOrientationProviderAndroid::LockOrientation(
blink::WebScreenOrientations orientations) {
if (j_screen_orientation_provider_.is_null()) {
j_screen_orientation_provider_.Reset(Java_ScreenOrientationProvider_create(
base::android::AttachCurrentThread()));
}
Java_ScreenOrientationProvider_lockOrientation(
base::android::AttachCurrentThread(),
j_screen_orientation_provider_.obj(), orientations);
}
void ScreenOrientationProviderAndroid::UnlockOrientation() {
if (j_screen_orientation_provider_.is_null())
return;
Java_ScreenOrientationProvider_unlockOrientation(
base::android::AttachCurrentThread(),
j_screen_orientation_provider_.obj());
}
ScreenOrientationProvider* ScreenOrientationDispatcherHost::CreateProvider() {
return new ScreenOrientationProviderAndroid();
}
}