diff options
author | John Reck <jreck@google.com> | 2012-04-12 09:54:26 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-04-12 09:54:26 -0700 |
commit | 137bd73ba09dcb5595235ea4cfaf710866394a6f (patch) | |
tree | 0b4d69efa31ff31be86a362fad1731b94d9a7418 /Source/WebKit/android/jni/WebViewCore.cpp | |
parent | 2c76a5a518095a481c7e028570087128b13f0c49 (diff) | |
parent | 09d5ed3cab4f6c40d9e670ea7c748c9e6c729605 (diff) | |
download | external_webkit-137bd73ba09dcb5595235ea4cfaf710866394a6f.zip external_webkit-137bd73ba09dcb5595235ea4cfaf710866394a6f.tar.gz external_webkit-137bd73ba09dcb5595235ea4cfaf710866394a6f.tar.bz2 |
Merge "Cleanup unused code"
Diffstat (limited to 'Source/WebKit/android/jni/WebViewCore.cpp')
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 111 |
1 files changed, 1 insertions, 110 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index cdd484b..ae00941 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -3124,27 +3124,6 @@ void WebViewCore::chromeTakeFocus(FocusDirection direction) env->CallVoidMethod(javaObject.get(), m_javaGlue->m_chromeTakeFocus, direction); } -// For when the user clicks the trackball, presses dpad center, or types into an -// unfocused textfield. In the latter case, 'fake' will be true -void WebViewCore::click(WebCore::Frame* frame, WebCore::Node* node, bool fake) { - if (!node) { - WebCore::IntPoint pt = m_mousePos; - pt.move(m_scrollOffsetX, m_scrollOffsetY); - WebCore::HitTestResult hitTestResult = m_mainFrame->eventHandler()-> - hitTestResultAtPoint(pt, false); - node = hitTestResult.innerNode(); - frame = node->document()->frame(); - } - if (node) { - EditorClientAndroid* client - = static_cast<EditorClientAndroid*>( - m_mainFrame->editor()->client()); - client->setShouldChangeSelectedRange(false); - handleMouseClick(frame, node, fake); - client->setShouldChangeSelectedRange(true); - } -} - #if USE(ACCELERATED_COMPOSITING) GraphicsLayerAndroid* WebViewCore::graphicsRootLayer() const { @@ -3199,14 +3178,6 @@ bool WebViewCore::handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint type = WebCore::TouchEnd; defaultTouchState = WebCore::PlatformTouchPoint::TouchStationary; break; - case 0x100: // WebViewCore.ACTION_LONGPRESS - type = WebCore::TouchLongPress; - defaultTouchState = WebCore::PlatformTouchPoint::TouchPressed; - break; - case 0x200: // WebViewCore.ACTION_DOUBLETAP - type = WebCore::TouchDoubleTap; - defaultTouchState = WebCore::PlatformTouchPoint::TouchPressed; - break; default: // We do not support other kinds of touch event inside WebCore // at the moment. @@ -3240,31 +3211,6 @@ bool WebViewCore::handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint return preventDefault; } -void WebViewCore::touchUp(int touchGeneration, - WebCore::Frame* frame, WebCore::Node* node, int x, int y) -{ - if (touchGeneration == 0) { - // m_mousePos should be set in getTouchHighlightRects() - WebCore::HitTestResult hitTestResult = m_mainFrame->eventHandler()->hitTestResultAtPoint(m_mousePos, false); - node = hitTestResult.innerNode(); - if (node) - frame = node->document()->frame(); - else - frame = 0; - } else { - if (m_touchGeneration > touchGeneration) - return; // short circuit if a newer touch has been generated - // This moves m_mousePos to the correct place, and handleMouseClick uses - // m_mousePos to determine where the click happens. - moveMouse(x, y); - m_lastGeneration = touchGeneration; - } - if (frame && validNode(m_mainFrame, frame, 0)) { - frame->loader()->resetMultipleFormSubmissionProtection(); - } - handleMouseClick(frame, node, false); -} - bool WebViewCore::performMouseClick() { WebCore::PlatformMouseEvent mouseDown(m_mousePos, m_mousePos, WebCore::LeftButton, @@ -3298,38 +3244,6 @@ static bool shouldSuppressKeyboard(const WebCore::Node* node) { return false; } -// Common code for both clicking with the trackball and touchUp -// Also used when typing into a non-focused textfield to give the textfield focus, -// in which case, 'fake' is set to true -bool WebViewCore::handleMouseClick(WebCore::Frame* framePtr, WebCore::Node* nodePtr, bool fake) -{ - bool valid = !framePtr || validNode(m_mainFrame, framePtr, nodePtr); - WebFrame* webFrame = WebFrame::getWebFrame(m_mainFrame); - if (valid && nodePtr) { - // Need to special case area tags because an image map could have an area element in the middle - // so when attempting to get the default, the point chosen would be follow the wrong link. - if (nodePtr->hasTagName(WebCore::HTMLNames::areaTag)) { - nodePtr->dispatchSimulatedClick(0, true, true); - return true; - } - } - if (!valid || !framePtr) - framePtr = m_mainFrame; - WebCore::PlatformMouseEvent mouseDown(m_mousePos, m_mousePos, WebCore::LeftButton, - WebCore::MouseEventPressed, 1, false, false, false, false, - WTF::currentTime()); - // ignore the return from as it will return true if the hit point can trigger selection change - framePtr->eventHandler()->handleMousePressEvent(mouseDown); - WebCore::PlatformMouseEvent mouseUp(m_mousePos, m_mousePos, WebCore::LeftButton, - WebCore::MouseEventReleased, 1, false, false, false, false, - WTF::currentTime()); - bool handled = framePtr->eventHandler()->handleMouseReleaseEvent(mouseUp); - - WebCore::Node* focusNode = currentFocus(); - initializeTextInput(focusNode, fake); - return handled; -} - WebViewCore::InputType WebViewCore::getInputType(Node* node) { WebCore::RenderObject* renderer = node->renderer(); @@ -4479,16 +4393,6 @@ static jboolean Key(JNIEnv* env, jobject obj, jint nativeClass, jint keyCode, unichar, repeatCount, isDown, isShift, isAlt, isSym)); } -static void Click(JNIEnv* env, jobject obj, jint nativeClass, int framePtr, - int nodePtr, jboolean fake) -{ - WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); - ALOG_ASSERT(viewImpl, "viewImpl not set in Click"); - - viewImpl->click(reinterpret_cast<WebCore::Frame*>(framePtr), - reinterpret_cast<WebCore::Node*>(nodePtr), fake); -} - static void ContentInvalidateAll(JNIEnv* env, jobject obj, jint nativeClass) { reinterpret_cast<WebViewCore*>(nativeClass)->contentInvalidateAll(); @@ -4666,15 +4570,6 @@ static jboolean HandleTouchEvent(JNIEnv* env, jobject obj, jint nativeClass, return viewImpl->handleTouchEvent(action, ids, points, actionIndex, metaState); } -static void TouchUp(JNIEnv* env, jobject obj, jint nativeClass, - jint touchGeneration, jint frame, jint node, jint x, jint y) -{ - WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); - ALOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__); - viewImpl->touchUp(touchGeneration, - (WebCore::Frame*) frame, (WebCore::Node*) node, x, y); -} - static bool MouseClick(JNIEnv* env, jobject obj, jint nativeClass) { WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); @@ -5064,8 +4959,6 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) FocusBoundsChanged } , { "nativeKey", "(IIIIZZZZ)Z", (void*) Key }, - { "nativeClick", "(IIIZ)V", - (void*) Click }, { "nativeContentInvalidateAll", "(I)V", (void*) ContentInvalidateAll }, { "nativeSendListBoxChoices", "(I[ZI)V", @@ -5099,9 +4992,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { { "nativeFindAddress", "(Ljava/lang/String;Z)Ljava/lang/String;", (void*) FindAddress }, { "nativeHandleTouchEvent", "(II[I[I[IIII)Z", - (void*) HandleTouchEvent }, - { "nativeTouchUp", "(IIIIII)V", - (void*) TouchUp }, + (void*) HandleTouchEvent }, { "nativeMouseClick", "(I)Z", (void*) MouseClick }, { "nativeRetrieveHref", "(III)Ljava/lang/String;", |