summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Grace Kloba <klobag@google.com> 2010-01-28 09:14:52 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2010-01-28 09:14:52 -0800
commit0561f1175dcbcaa19059eb5bde09cc02f81da0b3 (patch)
tree51aa1ee1d0c80fd65c529d10a40edff8c282448a
parent75d76bcf52587e4bfe00b7377d100510a3489674 (diff)
parent98e6fcf2f776743674d5af5ce6413aaffb50858d (diff)
Merge "Need to check parent for performLongClick() as it is the result of a delayed message."
-rw-r--r--core/java/android/webkit/WebView.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index ecea55fe4a9e..d018af05137e 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -2999,6 +2999,10 @@ public class WebView extends AbsoluteLayout
@Override
public boolean performLongClick() {
+ // performLongClick() is the result of a delayed message. If we switch
+ // to windows overview, the WebView will be temporarily removed from the
+ // view system. In that case, do nothing.
+ if (getParent() == null) return false;
if (mNativeClass != 0 && nativeCursorIsTextInput()) {
// Send the click so that the textfield is in focus
centerKeyPressOnTextField();
@@ -5922,13 +5926,7 @@ public class WebView extends AbsoluteLayout
// the states
mGotCenterDown = false;
mTrackballDown = false;
- // LONG_PRESS_CENTER is sent as a delayed message. If we
- // switch to windows overview, the WebView will be
- // temporarily removed from the view system. In that case,
- // do nothing.
- if (getParent() != null) {
- performLongClick();
- }
+ performLongClick();
break;
case WEBCORE_NEED_TOUCH_EVENTS: