diff options
| author | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-19 11:47:54 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-19 11:47:54 -0800 |
| commit | 16cdc1c75e84e6c6fed91095d72520f4cc5b5237 (patch) | |
| tree | d3db7e129a9529d736ec59ff5339e136cfcb955b /WebKit/android | |
| parent | a02602e4c650ddbff39da2c6e8cb2006db6f9ab8 (diff) | |
| parent | 27e40b2407e7e39b8fde83728baee90aae279760 (diff) | |
| download | external_webkit-16cdc1c75e84e6c6fed91095d72520f4cc5b5237.zip external_webkit-16cdc1c75e84e6c6fed91095d72520f4cc5b5237.tar.gz external_webkit-16cdc1c75e84e6c6fed91095d72520f4cc5b5237.tar.bz2 | |
Merge change Ifb1214a6 into eclair-mr2
* changes:
Change window focus only if the user initiated the event.
Diffstat (limited to 'WebKit/android')
| -rw-r--r-- | WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp | 11 | ||||
| -rw-r--r-- | WebKit/android/WebCoreSupport/ChromeClientAndroid.h | 4 |
2 files changed, 14 insertions, 1 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp index cfac25e..f441aa1 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp @@ -105,10 +105,19 @@ float ChromeClientAndroid::scaleFactor() return 1.0f; } +#ifdef ANDROID_USER_GESTURE +void ChromeClientAndroid::focus(bool userGesture) { +#else void ChromeClientAndroid::focus() { + // The old behavior was to always allow javascript to focus a window. If we + // turn off ANDROID_USER_GESTURE, go back to the old behavior by forcing + // userGesture to be true. + bool userGesture = true; +#endif ASSERT(m_webFrame); // Ask the application to focus this WebView. - m_webFrame->requestFocus(); + if (userGesture) + m_webFrame->requestFocus(); } void ChromeClientAndroid::unfocus() { notImplemented(); } diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h index 7bd7088..5ed785a 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h @@ -53,7 +53,11 @@ namespace android { virtual float scaleFactor(); +#ifdef ANDROID_USER_GESTURE + virtual void focus(bool userGesture); +#else virtual void focus(); +#endif virtual void unfocus(); virtual bool canTakeFocus(FocusDirection); |
