diff options
| author | Patrick Scott <phanna@android.com> | 2009-12-02 08:32:13 -0500 |
|---|---|---|
| committer | Patrick Scott <phanna@android.com> | 2009-12-09 12:36:31 -0500 |
| commit | 4b81185780aaef7695b652ceb7770e2307867c59 (patch) | |
| tree | a2944783f6d398e343e6dfa87e62f8607a2a9680 /WebKit/android | |
| parent | bf16ddc110ef3fde2cfa1ae43ab31d993377981d (diff) | |
| download | external_webkit-4b81185780aaef7695b652ceb7770e2307867c59.zip external_webkit-4b81185780aaef7695b652ceb7770e2307867c59.tar.gz external_webkit-4b81185780aaef7695b652ceb7770e2307867c59.tar.bz2 | |
Enable orientation events.
Remove our old orientation hacks as webkit now supports the orientation event.
Call down into webkit when the orientation changes to send the js event.
The change to Frame.cpp has been submited to bugs.webkit.org as issue 32321.
Diffstat (limited to 'WebKit/android')
| -rw-r--r-- | WebKit/android/jni/WebCoreFrameBridge.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index c420b4c..646c5b8 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -1487,6 +1487,16 @@ static jobject GetFormTextData(JNIEnv *env, jobject obj) return hashMap; } +static void OrientationChanged(JNIEnv *env, jobject obj, int orientation) +{ +#ifdef ANDROID_INSTRUMENT + TimeCounterAuto counter(TimeCounter::NativeCallbackTimeCounter); +#endif + WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj); + LOGE("Sending orientation: %d", orientation); + pFrame->sendOrientationChangeEvent(orientation); +} + // ---------------------------------------------------------------------------- /* @@ -1536,7 +1546,9 @@ static JNINativeMethod gBrowserFrameNativeMethods[] = { { "setUsernamePassword", "(Ljava/lang/String;Ljava/lang/String;)V", (void*) SetUsernamePassword }, { "getFormTextData", "()Ljava/util/HashMap;", - (void*) GetFormTextData } + (void*) GetFormTextData }, + { "nativeOrientationChanged", "(I)V", + (void*) OrientationChanged } }; int register_webframe(JNIEnv* env) |
