diff options
author | John Reck <jreck@google.com> | 2012-03-05 11:33:49 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-03-05 11:33:49 -0800 |
commit | 69c551b23300a3c735fb2b1f84d7682afd3d893a (patch) | |
tree | 6c25408bb573e5d47d87fe8161052dce6028a238 | |
parent | 2bd6000a1d89d3680bfbbc2c10cd9766c113d644 (diff) | |
parent | 472d57717072b12c8d13db9e42cac5516f187944 (diff) | |
download | external_webkit-69c551b23300a3c735fb2b1f84d7682afd3d893a.zip external_webkit-69c551b23300a3c735fb2b1f84d7682afd3d893a.tar.gz external_webkit-69c551b23300a3c735fb2b1f84d7682afd3d893a.tar.bz2 |
Merge "Delete more unused stuff from navcache"
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 141 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.h | 18 | ||||
-rw-r--r-- | Source/WebKit/android/nav/WebView.cpp | 493 |
3 files changed, 19 insertions, 633 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 7b3cf67..0113e2f 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -390,18 +390,12 @@ static jmethodID GetJMethod(JNIEnv* env, jclass clazz, const char name[], const } WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* mainframe) - : m_moveGeneration(0) - , m_touchGeneration(0) + : m_touchGeneration(0) , m_lastGeneration(0) - , m_findIsUp(false) , m_javaGlue(new JavaGlue) , m_mainFrame(mainframe) , m_popupReply(0) - , m_lastFocused(0) - , m_lastFocusedBounds(WebCore::IntRect(0,0,0,0)) , m_blurringNodePointer(0) - , m_lastFocusedSelStart(0) - , m_lastFocusedSelEnd(0) , m_blockTextfieldUpdates(false) , m_focusBoundsChanged(false) , m_skipContentDraw(false) @@ -411,14 +405,11 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m , m_scrollOffsetX(0) , m_scrollOffsetY(0) , m_mousePos(WebCore::IntPoint(0,0)) - , m_frameCacheOutOfDate(true) , m_progressDone(false) , m_screenWidth(320) , m_screenHeight(240) , m_textWrapWidth(320) , m_scale(1.0f) - , m_domtree_version(0) - , m_check_domtree_version(true) , m_groupForVisitedLinks(0) , m_isPaused(false) , m_cacheMode(0) @@ -1075,11 +1066,10 @@ void WebViewCore::requestKeyboard(bool showKeyboard) void WebViewCore::notifyProgressFinished() { - m_check_domtree_version = true; sendNotifyProgressFinished(); } -void WebViewCore::setScrollOffset(int moveGeneration, bool sendScrollEvent, int dx, int dy) +void WebViewCore::setScrollOffset(bool sendScrollEvent, int dx, int dy) { if (m_scrollOffsetX != dx || m_scrollOffsetY != dy) { m_scrollOffsetX = dx; @@ -1450,7 +1440,7 @@ VisiblePosition WebViewCore::visiblePositionForContentPoint(const IntPoint& poin void WebViewCore::selectWordAt(int x, int y) { HitTestResult hoverResult; - moveMouse(m_mainFrame, x, y, &hoverResult); + moveMouse(x, y, &hoverResult); if (hoverResult.innerNode()) { Node* node = hoverResult.innerNode(); Frame* frame = node->document()->frame(); @@ -1682,7 +1672,7 @@ void WebViewCore::selectText(int startX, int startY, int endX, int endY) AndroidHitTestResult WebViewCore::hitTestAtPoint(int x, int y, int slop, bool doMoveMouse) { if (doMoveMouse) - moveMouse(m_mainFrame, x, y); + moveMouse(x, y); HitTestResult hitTestResult = m_mainFrame->eventHandler()->hitTestResultAtPoint(IntPoint(x, y), false, false, DontHitTestScrollbars, HitTestRequest::Active | HitTestRequest::ReadOnly, IntSize(slop, slop)); AndroidHitTestResult androidHitResult(this, hitTestResult); @@ -1845,7 +1835,7 @@ AndroidHitTestResult WebViewCore::hitTestAtPoint(int x, int y, int slop, bool do testRect.move(frameAdjust.x(), frameAdjust.y()); testRect.intersect(rect); if (!testRect.contains(x, y)) - moveMouse(m_mainFrame, testRect.center().x(), testRect.center().y()); + moveMouse(testRect.center().x(), testRect.center().y()); } } else { androidHitResult.searchContentDetectors(); @@ -2022,39 +2012,10 @@ static PluginView* nodeIsPlugin(Node* node) { } /////////////////////////////////////////////////////////////////////////////// -void WebViewCore::moveMouseIfLatest(int moveGeneration, - WebCore::Frame* frame, int x, int y) -{ - if (m_moveGeneration > moveGeneration) { - return; // short-circuit if a newer move has already been generated - } - m_lastGeneration = moveGeneration; - moveMouse(frame, x, y); -} - -void WebViewCore::moveFocus(WebCore::Frame* frame, WebCore::Node* node) -{ - if (!node || !validNode(m_mainFrame, frame, node) - || !node->isElementNode()) - return; - // Code borrowed from FocusController::advanceFocus - WebCore::FocusController* focusController - = m_mainFrame->page()->focusController(); - WebCore::Document* oldDoc - = focusController->focusedOrMainFrame()->document(); - if (oldDoc->focusedNode() == node) - return; - if (node->document() != oldDoc) - oldDoc->setFocusedNode(0); - focusController->setFocusedFrame(frame); - static_cast<WebCore::Element*>(node)->focus(false); -} // Update mouse position -void WebViewCore::moveMouse(WebCore::Frame* frame, int x, int y, HitTestResult* hoveredNode) +void WebViewCore::moveMouse(int x, int y, HitTestResult* hoveredNode) { - if (!frame || !validNode(m_mainFrame, frame, 0)) - frame = m_mainFrame; // mouse event expects the position in the window coordinate m_mousePos = WebCore::IntPoint(x - m_scrollOffsetX, y - m_scrollOffsetY); // validNode will still return true if the node is null, as long as we have @@ -2062,7 +2023,7 @@ void WebViewCore::moveMouse(WebCore::Frame* frame, int x, int y, HitTestResult* WebCore::PlatformMouseEvent mouseEvent(m_mousePos, m_mousePos, WebCore::NoButton, WebCore::MouseEventMoved, 1, false, false, false, false, WTF::currentTime()); - frame->eventHandler()->handleMouseMoveEvent(mouseEvent, hoveredNode); + m_mainFrame->eventHandler()->handleMouseMoveEvent(mouseEvent, hoveredNode); } Position WebViewCore::getPositionForOffset(Node* node, int offset) @@ -3159,7 +3120,7 @@ void WebViewCore::touchUp(int 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(frame, x, y); + moveMouse(x, y); m_lastGeneration = touchGeneration; } if (frame && validNode(m_mainFrame, frame, 0)) { @@ -3859,21 +3820,6 @@ void WebViewCore::keepScreenOn(bool screenOn) { m_screenOnCounter--; } -bool WebViewCore::validNodeAndBounds(Frame* frame, Node* node, - const IntRect& originalAbsoluteBounds) -{ - bool valid = validNode(m_mainFrame, frame, node); - if (!valid) - return false; - RenderObject* renderer = node->renderer(); - if (!renderer) - return false; - IntRect absBounds = node->hasTagName(HTMLNames::areaTag) - ? getAreaRect(static_cast<HTMLAreaElement*>(node)) - : renderer->absoluteBoundingBoxRect(); - return absBounds == originalAbsoluteBounds; -} - void WebViewCore::showRect(int left, int top, int width, int height, int contentWidth, int contentHeight, float xPercentInDoc, float xPercentInView, float yPercentInDoc, float yPercentInView) @@ -4241,10 +4187,6 @@ static void ClearContent(JNIEnv* env, jobject obj, jint nativeClass) viewImpl->clearContent(); } -static void UpdateFrameCacheIfLoading(JNIEnv* env, jobject obj, jint nativeClass) -{ -} - static void SetSize(JNIEnv* env, jobject obj, jint nativeClass, jint width, jint height, jint textWrapWidth, jfloat scale, jint screenWidth, jint screenHeight, jint anchorX, jint anchorY, jboolean ignoreHeight) @@ -4257,12 +4199,12 @@ static void SetSize(JNIEnv* env, jobject obj, jint nativeClass, jint width, } static void SetScrollOffset(JNIEnv* env, jobject obj, jint nativeClass, - jint gen, jboolean sendScrollEvent, jint x, jint y) + jboolean sendScrollEvent, jint x, jint y) { WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); ALOG_ASSERT(viewImpl, "need viewImpl"); - viewImpl->setScrollOffset(gen, sendScrollEvent, x, y); + viewImpl->setScrollOffset(sendScrollEvent, x, y); } static void SetGlobalBounds(JNIEnv* env, jobject obj, jint nativeClass, @@ -4355,13 +4297,12 @@ static void SetFocusControllerActive(JNIEnv* env, jobject obj, jint nativeClass, viewImpl->setFocusControllerActive(active); } -static void SaveDocumentState(JNIEnv* env, jobject obj, jint nativeClass, - jint frame) +static void SaveDocumentState(JNIEnv* env, jobject obj, jint nativeClass) { ALOGV("webviewcore::nativeSaveDocumentState()\n"); WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); ALOG_ASSERT(viewImpl, "viewImpl not set in nativeSaveDocumentState"); - viewImpl->saveDocumentState((WebCore::Frame*) frame); + viewImpl->saveDocumentState(viewImpl->focusedFrame()); } void WebViewCore::addVisitedLink(const UChar* string, int length) @@ -4521,33 +4462,11 @@ static jstring RetrieveImageSource(JNIEnv* env, jobject obj, jint nativeClass, return !result.isEmpty() ? wtfStringToJstring(env, result) : 0; } -static void MoveFocus(JNIEnv* env, jobject obj, jint nativeClass, jint framePtr, - jint nodePtr) -{ - WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); - ALOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__); - viewImpl->moveFocus((WebCore::Frame*) framePtr, (WebCore::Node*) nodePtr); -} - -static void MoveMouse(JNIEnv* env, jobject obj, jint nativeClass, jint frame, - jint x, jint y) -{ - WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); - ALOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__); - viewImpl->moveMouse((WebCore::Frame*) frame, x, y); -} - -static void MoveMouseIfLatest(JNIEnv* env, jobject obj, jint nativeClass, - jint moveGeneration, jint frame, jint x, jint y) +static void MoveMouse(JNIEnv* env, jobject obj, jint nativeClass, jint x, jint y) { WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); ALOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__); - viewImpl->moveMouseIfLatest(moveGeneration, - (WebCore::Frame*) frame, x, y); -} - -static void UpdateFrameCache(JNIEnv* env, jobject obj, jint nativeClass) -{ + viewImpl->moveMouse(x, y); } static jint GetContentMinPrefWidth(JNIEnv* env, jobject obj, jint nativeClass) @@ -4616,10 +4535,6 @@ static void DumpRenderTree(JNIEnv* env, jobject obj, jint nativeClass, viewImpl->dumpRenderTree(useFile); } -static void DumpNavTree(JNIEnv* env, jobject obj, jint nativeClass) -{ -} - static void SetJsFlags(JNIEnv* env, jobject obj, jint nativeClass, jstring flags) { WTF::String flagsString = jstringToWtfString(env, flags); @@ -4776,16 +4691,6 @@ static WebCore::IntRect jrect_to_webrect(JNIEnv* env, jobject obj) return WebCore::IntRect(L, T, R - L, B - T); } -static bool ValidNodeAndBounds(JNIEnv* env, jobject obj, jint nativeClass, - int frame, int node, jobject rect) -{ - IntRect nativeRect = jrect_to_webrect(env, rect); - WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); - return viewImpl->validNodeAndBounds( - reinterpret_cast<Frame*>(frame), - reinterpret_cast<Node*>(node), nativeRect); -} - static jobject HitTest(JNIEnv* env, jobject obj, jint nativeClass, jint x, jint y, jint slop, jboolean doMoveMouse) { @@ -4920,7 +4825,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) SendListBoxChoice }, { "nativeSetSize", "(IIIIFIIIIZ)V", (void*) SetSize }, - { "nativeSetScrollOffset", "(IIZII)V", + { "nativeSetScrollOffset", "(IZII)V", (void*) SetScrollOffset }, { "nativeSetGlobalBounds", "(IIIII)V", (void*) SetGlobalBounds }, @@ -4932,19 +4837,15 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) DeleteSelection } , { "nativeReplaceTextfieldText", "(IIILjava/lang/String;III)V", (void*) ReplaceTextfieldText } , - { "nativeMoveFocus", "(III)V", - (void*) MoveFocus }, - { "nativeMoveMouse", "(IIII)V", + { "nativeMoveMouse", "(III)V", (void*) MoveMouse }, - { "nativeMoveMouseIfLatest", "(IIIII)V", - (void*) MoveMouseIfLatest }, { "passToJs", "(IILjava/lang/String;IIZZZZ)V", (void*) PassToJs }, { "nativeScrollFocusedTextInput", "(IFI)V", (void*) ScrollFocusedTextInput }, { "nativeSetFocusControllerActive", "(IZ)V", (void*) SetFocusControllerActive }, - { "nativeSaveDocumentState", "(II)V", + { "nativeSaveDocumentState", "(I)V", (void*) SaveDocumentState }, { "nativeFindAddress", "(Ljava/lang/String;Z)Ljava/lang/String;", (void*) FindAddress }, @@ -4958,8 +4859,6 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) RetrieveAnchorText }, { "nativeRetrieveImageSource", "(III)Ljava/lang/String;", (void*) RetrieveImageSource }, - { "nativeUpdateFrameCache", "(I)V", - (void*) UpdateFrameCache }, { "nativeGetContentMinPrefWidth", "(I)I", (void*) GetContentMinPrefWidth }, { "nativeUpdateLayers", "(II)Z", @@ -4980,8 +4879,6 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) DumpDomTree }, { "nativeDumpRenderTree", "(IZ)V", (void*) DumpRenderTree }, - { "nativeDumpNavTree", "(I)V", - (void*) DumpNavTree }, { "nativeSetNewStorageLimit", "(IJ)V", (void*) SetNewStorageLimit }, { "nativeGeolocationPermissionsProvide", "(ILjava/lang/String;ZZ)V", @@ -4994,16 +4891,12 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { { "nativeRequestLabel", "(III)Ljava/lang/String;", (void*) RequestLabel }, { "nativeRevealSelection", "(I)V", (void*) RevealSelection }, - { "nativeUpdateFrameCacheIfLoading", "(I)V", - (void*) UpdateFrameCacheIfLoading }, { "nativeProvideVisitedHistory", "(I[Ljava/lang/String;)V", (void*) ProvideVisitedHistory }, { "nativeFullScreenPluginHidden", "(II)V", (void*) FullScreenPluginHidden }, { "nativePluginSurfaceReady", "(I)V", (void*) PluginSurfaceReady }, - { "nativeValidNodeAndBounds", "(IIILandroid/graphics/Rect;)Z", - (void*) ValidNodeAndBounds }, { "nativeHitTest", "(IIIIZ)Landroid/webkit/WebViewCore$WebKitHitTest;", (void*) HitTest }, { "nativeAutoFillForm", "(II)V", diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h index cc7ff12..4cbc566 100644 --- a/Source/WebKit/android/jni/WebViewCore.h +++ b/Source/WebKit/android/jni/WebViewCore.h @@ -302,13 +302,10 @@ namespace android { // scroll the selection on screen (if necessary). void revealSelection(); - void moveFocus(WebCore::Frame* frame, WebCore::Node* node); - void moveMouse(WebCore::Frame* frame, int x, int y, HitTestResult* hoveredNode = 0); - void moveMouseIfLatest(int moveGeneration, - WebCore::Frame* frame, int x, int y); + void moveMouse(int x, int y, HitTestResult* hoveredNode = 0); // set the scroll amount that webview.java is currently showing - void setScrollOffset(int moveGeneration, bool sendScrollEvent, int dx, int dy); + void setScrollOffset(bool sendScrollEvent, int dx, int dy); void setGlobalBounds(int x, int y, int h, int v); @@ -495,8 +492,6 @@ namespace android { // Manages requests to keep the screen on while the WebView is visible void keepScreenOn(bool screenOn); - bool validNodeAndBounds(Frame* , Node* , const IntRect& ); - // Make the rect (left, top, width, height) visible. If it can be fully // fit, center it on the screen. Otherwise make sure the point specified // by (left + xPercentInDoc * width, top + yPercentInDoc * height) @@ -609,10 +604,8 @@ namespace android { WebCore::VisiblePosition visiblePositionForWindowPoint(int x, int y); // these members are shared with webview.cpp - int m_moveGeneration; // copy of state in WebViewNative triggered by move int m_touchGeneration; // copy of state in WebViewNative triggered by touch int m_lastGeneration; // last action using up to date cache - bool m_findIsUp; // end of shared members // internal functions @@ -727,11 +720,7 @@ namespace android { struct JavaGlue* m_javaGlue; WebCore::Frame* m_mainFrame; WebCoreReply* m_popupReply; - WebCore::Node* m_lastFocused; - WebCore::IntRect m_lastFocusedBounds; int m_blurringNodePointer; - int m_lastFocusedSelStart; - int m_lastFocusedSelEnd; PictureSet m_content; // the set of pictures to draw SkRegion m_addInval; // the accumulated inval region (not yet drawn) SkRegion m_rebuildInval; // the accumulated region for rebuilt pictures @@ -748,14 +737,11 @@ namespace android { int m_scrollOffsetX; // webview.java's current scroll in X int m_scrollOffsetY; // webview.java's current scroll in Y WebCore::IntPoint m_mousePos; - bool m_frameCacheOutOfDate; bool m_progressDone; int m_screenWidth; // width of the visible rect in document coordinates int m_screenHeight;// height of the visible rect in document coordinates int m_textWrapWidth; float m_scale; - unsigned m_domtree_version; - bool m_check_domtree_version; PageGroup* m_groupForVisitedLinks; bool m_isPaused; int m_cacheMode; diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index 5924d5e..830ef4e 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -112,17 +112,10 @@ enum DrawExtras { // keep this in sync with WebView.java struct JavaGlue { jweak m_obj; - jmethodID m_overrideLoading; jmethodID m_scrollBy; - jmethodID m_sendMoveFocus; - jmethodID m_sendMoveMouse; - jmethodID m_sendMoveMouseIfLatest; - jmethodID m_sendMotionUp; - jmethodID m_domChangedFocus; jmethodID m_getScaledMaxXScroll; jmethodID m_getScaledMaxYScroll; jmethodID m_getVisibleRect; - jmethodID m_rebuildWebTextView; jmethodID m_viewInvalidate; jmethodID m_viewInvalidateRect; jmethodID m_postInvalidateDelayed; @@ -131,10 +124,6 @@ struct JavaGlue { jfieldID m_rectTop; jmethodID m_rectWidth; jmethodID m_rectHeight; - jfieldID m_rectFLeft; - jfieldID m_rectFTop; - jmethodID m_rectFWidth; - jmethodID m_rectFHeight; AutoJObject object(JNIEnv* env) { return getRealObject(env, m_obj); } @@ -146,19 +135,11 @@ WebView(JNIEnv* env, jobject javaWebView, int viewImpl, WTF::String drawableDir, { memset(m_extras, 0, DRAW_EXTRAS_SIZE * sizeof(DrawExtra*)); jclass clazz = env->FindClass("android/webkit/WebViewClassic"); - // m_javaGlue = new JavaGlue; m_javaGlue.m_obj = env->NewWeakGlobalRef(javaWebView); m_javaGlue.m_scrollBy = GetJMethod(env, clazz, "setContentScrollBy", "(IIZ)Z"); - m_javaGlue.m_overrideLoading = GetJMethod(env, clazz, "overrideLoading", "(Ljava/lang/String;)V"); - m_javaGlue.m_sendMoveFocus = GetJMethod(env, clazz, "sendMoveFocus", "(II)V"); - m_javaGlue.m_sendMoveMouse = GetJMethod(env, clazz, "sendMoveMouse", "(IIII)V"); - m_javaGlue.m_sendMoveMouseIfLatest = GetJMethod(env, clazz, "sendMoveMouseIfLatest", "(ZZ)V"); - m_javaGlue.m_sendMotionUp = GetJMethod(env, clazz, "sendMotionUp", "(IIIII)V"); - m_javaGlue.m_domChangedFocus = GetJMethod(env, clazz, "domChangedFocus", "()V"); m_javaGlue.m_getScaledMaxXScroll = GetJMethod(env, clazz, "getScaledMaxXScroll", "()I"); m_javaGlue.m_getScaledMaxYScroll = GetJMethod(env, clazz, "getScaledMaxYScroll", "()I"); m_javaGlue.m_getVisibleRect = GetJMethod(env, clazz, "sendOurVisibleRect", "()Landroid/graphics/Rect;"); - m_javaGlue.m_rebuildWebTextView = GetJMethod(env, clazz, "rebuildWebTextView", "()V"); m_javaGlue.m_viewInvalidate = GetJMethod(env, clazz, "viewInvalidate", "()V"); m_javaGlue.m_viewInvalidateRect = GetJMethod(env, clazz, "viewInvalidate", "(IIII)V"); m_javaGlue.m_postInvalidateDelayed = GetJMethod(env, clazz, @@ -174,14 +155,6 @@ WebView(JNIEnv* env, jobject javaWebView, int viewImpl, WTF::String drawableDir, m_javaGlue.m_rectHeight = GetJMethod(env, rectClass, "height", "()I"); env->DeleteLocalRef(rectClass); - jclass rectClassF = env->FindClass("android/graphics/RectF"); - ALOG_ASSERT(rectClassF, "Could not find RectF class"); - m_javaGlue.m_rectFLeft = env->GetFieldID(rectClassF, "left", "F"); - m_javaGlue.m_rectFTop = env->GetFieldID(rectClassF, "top", "F"); - m_javaGlue.m_rectFWidth = GetJMethod(env, rectClassF, "width", "()F"); - m_javaGlue.m_rectFHeight = GetJMethod(env, rectClassF, "height", "()F"); - env->DeleteLocalRef(rectClassF); - env->SetIntField(javaWebView, gWebViewField, (jint)this); m_viewImpl = (WebViewCore*) viewImpl; m_generation = 0; @@ -404,11 +377,6 @@ IntRect getVisibleRect() return rect; } -void notifyProgressFinished() -{ - rebuildWebTextView(); -} - #if USE(ACCELERATED_COMPOSITING) static const ScrollableLayerAndroid* findScrollableLayer( const LayerAndroid* parent, int x, int y, SkIRect* foundBounds) { @@ -467,22 +435,6 @@ void scrollLayer(int layerId, int x, int y) m_glWebViewState->scrollLayer(layerId, x, y); } -void overrideUrlLoading(const WTF::String& url) -{ - JNIEnv* env = JSC::Bindings::getJNIEnv(); - AutoJObject javaObject = m_javaGlue.object(env); - if (!javaObject.get()) - return; - jstring jName = wtfStringToJstring(env, url); - env->CallVoidMethod(javaObject.get(), m_javaGlue.m_overrideLoading, jName); - env->DeleteLocalRef(jName); -} - -void setFindIsUp(bool up) -{ - m_viewImpl->m_findIsUp = up; -} - void setHeightCanMeasure(bool measure) { m_heightCanMeasure = measure; @@ -497,50 +449,6 @@ String getSelection() return String(); } -void sendMoveFocus(WebCore::Frame* framePtr, WebCore::Node* nodePtr) -{ - JNIEnv* env = JSC::Bindings::getJNIEnv(); - AutoJObject javaObject = m_javaGlue.object(env); - if (!javaObject.get()) - return; - env->CallVoidMethod(javaObject.get(), m_javaGlue.m_sendMoveFocus, (jint) framePtr, (jint) nodePtr); - checkException(env); -} - -void sendMoveMouse(WebCore::Frame* framePtr, WebCore::Node* nodePtr, int x, int y) -{ - JNIEnv* env = JSC::Bindings::getJNIEnv(); - AutoJObject javaObject = m_javaGlue.object(env); - if (!javaObject.get()) - return; - env->CallVoidMethod(javaObject.get(), m_javaGlue.m_sendMoveMouse, reinterpret_cast<jint>(framePtr), reinterpret_cast<jint>(nodePtr), x, y); - checkException(env); -} - -void sendMoveMouseIfLatest(bool clearTextEntry, bool stopPaintingCaret) -{ - ALOG_ASSERT(m_javaGlue.m_obj, "A java object was not associated with this native WebView!"); - JNIEnv* env = JSC::Bindings::getJNIEnv(); - AutoJObject javaObject = m_javaGlue.object(env); - if (!javaObject.get()) - return; - env->CallVoidMethod(javaObject.get(), m_javaGlue.m_sendMoveMouseIfLatest, clearTextEntry, stopPaintingCaret); - checkException(env); -} - -void sendMotionUp(WebCore::Frame* framePtr, WebCore::Node* nodePtr, int x, int y) -{ - ALOG_ASSERT(m_javaGlue.m_obj, "A WebView was not associated with this WebViewNative!"); - - JNIEnv* env = JSC::Bindings::getJNIEnv(); - AutoJObject javaObject = m_javaGlue.object(env); - if (!javaObject.get()) - return; - m_viewImpl->m_touchGeneration = ++m_generation; - env->CallVoidMethod(javaObject.get(), m_javaGlue.m_sendMotionUp, m_generation, (jint) framePtr, (jint) nodePtr, x, y); - checkException(env); -} - bool scrollBy(int dx, int dy) { ALOG_ASSERT(m_javaGlue.m_obj, "A java object was not associated with this native WebView!"); @@ -562,16 +470,6 @@ void setIsScrolling(bool isScrolling) #endif } -void rebuildWebTextView() -{ - JNIEnv* env = JSC::Bindings::getJNIEnv(); - AutoJObject javaObject = m_javaGlue.object(env); - if (!javaObject.get()) - return; - env->CallVoidMethod(javaObject.get(), m_javaGlue.m_rebuildWebTextView); - checkException(env); -} - void viewInvalidate() { JNIEnv* env = JSC::Bindings::getJNIEnv(); @@ -603,11 +501,6 @@ void postInvalidateDelayed(int64_t delay, const WebCore::IntRect& bounds) checkException(env); } -int moveGeneration() -{ - return m_viewImpl->m_moveGeneration; -} - LayerAndroid* compositeRoot() const { ALOG_ASSERT(!m_baseLayer || m_baseLayer->countChildren() == 1, @@ -837,29 +730,6 @@ class GLDrawFunctor : Functor { /* * Native JNI methods */ -static int nativeCacheHitFramePointer(JNIEnv *env, jobject obj) -{ - return 0; -} - -static jobject nativeCacheHitNodeBounds(JNIEnv *env, jobject obj) -{ - return 0; -} - -static int nativeCacheHitNodePointer(JNIEnv *env, jobject obj) -{ - return 0; -} - -static bool nativeCacheHitIsPlugin(JNIEnv *env, jobject obj) -{ - return false; -} - -static void nativeClearCursor(JNIEnv *env, jobject obj) -{ -} static void nativeCreate(JNIEnv *env, jobject obj, int viewImpl, jstring drawableDir, jboolean isHighEndGfx) @@ -870,36 +740,6 @@ static void nativeCreate(JNIEnv *env, jobject obj, int viewImpl, //Release(obj); } -static jint nativeCursorFramePointer(JNIEnv *env, jobject obj) -{ - return 0; -} - -static bool focusCandidateHasNextTextfield(JNIEnv *env, jobject obj) -{ - return false; -} - -static jboolean nativePageShouldHandleShiftAndArrows(JNIEnv *env, jobject obj) -{ - return true; -} - -static jobject nativeCursorNodeBounds(JNIEnv *env, jobject obj) -{ - return 0; -} - -static jint nativeCursorNodePointer(JNIEnv *env, jobject obj) -{ - return 0; -} - -static jobject nativeCursorPosition(JNIEnv *env, jobject obj) -{ - return 0; -} - static WebCore::IntRect jrect_to_webrect(JNIEnv* env, jobject obj) { if (obj) { @@ -918,30 +758,6 @@ static SkRect jrectf_to_rect(JNIEnv* env, jobject obj) return rect; } -static bool nativeCursorIntersects(JNIEnv *env, jobject obj, jobject visRect) -{ - return false; -} - -static bool nativeCursorIsAnchor(JNIEnv *env, jobject obj) -{ - return false; -} - -static bool nativeCursorIsTextInput(JNIEnv *env, jobject obj) -{ - return false; -} - -static jobject nativeCursorText(JNIEnv *env, jobject obj) -{ - return 0; -} - -static void nativeDebugDump(JNIEnv *env, jobject obj) -{ -} - static jint nativeDraw(JNIEnv *env, jobject obj, jobject canv, jobject visible, jint color, jint extras, jboolean split) { @@ -1040,128 +856,6 @@ static bool nativeHasContent(JNIEnv *env, jobject obj) return GET_NATIVE_VIEW(env, obj)->hasContent(); } -static jobject nativeImageURI(JNIEnv *env, jobject obj, jint x, jint y) -{ - return 0; -} - -static jint nativeFocusCandidateFramePointer(JNIEnv *env, jobject obj) -{ - return 0; -} - -static bool nativeFocusCandidateIsEditableText(JNIEnv* env, jobject obj, - jint nativeClass) -{ - return false; -} - -static bool nativeFocusCandidateIsPassword(JNIEnv *env, jobject obj) -{ - return false; -} - -static bool nativeFocusCandidateIsRtlText(JNIEnv *env, jobject obj) -{ - return false; -} - -static bool nativeFocusCandidateIsTextInput(JNIEnv *env, jobject obj) -{ - return false; -} - -static jint nativeFocusCandidateMaxLength(JNIEnv *env, jobject obj) -{ - return 0; -} - -static jint nativeFocusCandidateIsAutoComplete(JNIEnv *env, jobject obj) -{ - return 0; -} - -static jobject nativeFocusCandidateName(JNIEnv *env, jobject obj) -{ - return false; -} - -static jobject nativeFocusCandidateNodeBounds(JNIEnv *env, jobject obj) -{ - return 0; -} - -static jobject nativeFocusCandidatePaddingRect(JNIEnv *env, jobject obj) -{ - return 0; -} - -static jint nativeFocusCandidatePointer(JNIEnv *env, jobject obj) -{ - return 0; -} - -static jint nativeFocusCandidateIsSpellcheck(JNIEnv *env, jobject obj) -{ - return 0; -} - -static jobject nativeFocusCandidateText(JNIEnv *env, jobject obj) -{ - return 0; -} - -static int nativeFocusCandidateLineHeight(JNIEnv *env, jobject obj) -{ - return 0; -} - -static jfloat nativeFocusCandidateTextSize(JNIEnv *env, jobject obj) -{ - return 0.f; -} - -static int nativeFocusCandidateType(JNIEnv *env, jobject obj) -{ - return 0; -} - -static int nativeFocusCandidateLayerId(JNIEnv *env, jobject obj) -{ - return 0; -} - -static bool nativeFocusIsPlugin(JNIEnv *env, jobject obj) -{ - return false; -} - -static jobject nativeFocusNodeBounds(JNIEnv *env, jobject obj) -{ - return 0; -} - -static jint nativeFocusNodePointer(JNIEnv *env, jobject obj) -{ - return 0; -} - -static bool nativeCursorWantsKeyEvents(JNIEnv* env, jobject jwebview) { - return false; -} - -static void nativeHideCursor(JNIEnv *env, jobject obj) -{ -} - -static void nativeSelectBestAt(JNIEnv *env, jobject obj, jobject jrect) -{ -} - -static void nativeSelectAt(JNIEnv *env, jobject obj, jint x, jint y) -{ -} - static jobject nativeLayerBounds(JNIEnv* env, jobject obj, jint jlayer) { SkRect r; @@ -1201,50 +895,6 @@ static jobject nativeSubtractLayers(JNIEnv* env, jobject obj, jobject jrect) return rect; } -static jint nativeTextGeneration(JNIEnv *env, jobject obj) -{ - return 0; -} - -static bool nativePointInNavCache(JNIEnv *env, jobject obj, - int x, int y, int slop) -{ - return false; -} - -static bool nativeMotionUp(JNIEnv *env, jobject obj, - int x, int y, int slop) -{ - return false; -} - -static bool nativeHasCursorNode(JNIEnv *env, jobject obj) -{ - return false; -} - -static bool nativeHasFocusNode(JNIEnv *env, jobject obj) -{ - return false; -} - -static bool nativeMoveCursor(JNIEnv *env, jobject obj, - int key, int count, bool ignoreScroll) -{ - return false; -} - -static void nativeSetFindIsUp(JNIEnv *env, jobject obj, jboolean isUp) -{ - WebView* view = GET_NATIVE_VIEW(env, obj); - ALOG_ASSERT(view, "view not set in %s", __FUNCTION__); - view->setFindIsUp(isUp); -} - -static void nativeShowCursorTimed(JNIEnv *env, jobject obj) -{ -} - static void nativeSetHeightCanMeasure(JNIEnv *env, jobject obj, bool measure) { WebView* view = GET_NATIVE_VIEW(env, obj); @@ -1252,21 +902,6 @@ static void nativeSetHeightCanMeasure(JNIEnv *env, jobject obj, bool measure) view->setHeightCanMeasure(measure); } -static jobject nativeGetCursorRingBounds(JNIEnv *env, jobject obj) -{ - return 0; -} - -static void nativeUpdateCachedTextfield(JNIEnv *env, jobject obj, jstring updatedText, jint generation) -{ -} - -static jint nativeGetBlockLeftEdge(JNIEnv *env, jobject obj, jint x, jint y, - jfloat scale) -{ - return -1; -} - static void nativeDestroy(JNIEnv *env, jobject obj) { WebView* view = GET_NATIVE_VIEW(env, obj); @@ -1280,19 +915,6 @@ static void nativeStopGL(JNIEnv *env, jobject obj) GET_NATIVE_VIEW(env, obj)->stopGL(); } -static bool nativeMoveCursorToNextTextInput(JNIEnv *env, jobject obj) -{ - return false; -} - -static int nativeMoveGeneration(JNIEnv *env, jobject obj) -{ - WebView* view = GET_NATIVE_VIEW(env, obj); - if (!view) - return 0; - return view->moveGeneration(); -} - static jobject nativeGetSelection(JNIEnv *env, jobject obj) { WebView* view = GET_NATIVE_VIEW(env, obj); @@ -1536,11 +1158,6 @@ static void nativeSetPauseDrawing(JNIEnv *env, jobject obj, jint nativeView, ((WebView*)nativeView)->m_isDrawingPaused = pause; } -static bool nativeDisableNavcache(JNIEnv *env, jobject obj) -{ - return true; -} - static void nativeSetTextSelection(JNIEnv *env, jobject obj, jint nativeView, jint selectionPtr) { @@ -1571,40 +1188,8 @@ static jboolean nativeIsBaseFirst(JNIEnv *env, jobject obj, jint nativeView) * JNI registration */ static JNINativeMethod gJavaWebViewMethods[] = { - { "nativeCacheHitFramePointer", "()I", - (void*) nativeCacheHitFramePointer }, - { "nativeCacheHitIsPlugin", "()Z", - (void*) nativeCacheHitIsPlugin }, - { "nativeCacheHitNodeBounds", "()Landroid/graphics/Rect;", - (void*) nativeCacheHitNodeBounds }, - { "nativeCacheHitNodePointer", "()I", - (void*) nativeCacheHitNodePointer }, - { "nativeClearCursor", "()V", - (void*) nativeClearCursor }, { "nativeCreate", "(ILjava/lang/String;Z)V", (void*) nativeCreate }, - { "nativeCursorFramePointer", "()I", - (void*) nativeCursorFramePointer }, - { "nativePageShouldHandleShiftAndArrows", "()Z", - (void*) nativePageShouldHandleShiftAndArrows }, - { "nativeCursorNodeBounds", "()Landroid/graphics/Rect;", - (void*) nativeCursorNodeBounds }, - { "nativeCursorNodePointer", "()I", - (void*) nativeCursorNodePointer }, - { "nativeCursorIntersects", "(Landroid/graphics/Rect;)Z", - (void*) nativeCursorIntersects }, - { "nativeCursorIsAnchor", "()Z", - (void*) nativeCursorIsAnchor }, - { "nativeCursorIsTextInput", "()Z", - (void*) nativeCursorIsTextInput }, - { "nativeCursorPosition", "()Landroid/graphics/Point;", - (void*) nativeCursorPosition }, - { "nativeCursorText", "()Ljava/lang/String;", - (void*) nativeCursorText }, - { "nativeCursorWantsKeyEvents", "()Z", - (void*)nativeCursorWantsKeyEvents }, - { "nativeDebugDump", "()V", - (void*) nativeDebugDump }, { "nativeDestroy", "()V", (void*) nativeDestroy }, { "nativeDraw", "(Landroid/graphics/Canvas;Landroid/graphics/RectF;IIZ)I", @@ -1617,76 +1202,10 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeDumpDisplayTree }, { "nativeEvaluateLayersAnimations", "(I)Z", (void*) nativeEvaluateLayersAnimations }, - { "nativeFocusCandidateFramePointer", "()I", - (void*) nativeFocusCandidateFramePointer }, - { "nativeFocusCandidateHasNextTextfield", "()Z", - (void*) focusCandidateHasNextTextfield }, - { "nativeFocusCandidateIsPassword", "()Z", - (void*) nativeFocusCandidateIsPassword }, - { "nativeFocusCandidateIsRtlText", "()Z", - (void*) nativeFocusCandidateIsRtlText }, - { "nativeFocusCandidateIsTextInput", "()Z", - (void*) nativeFocusCandidateIsTextInput }, - { "nativeFocusCandidateLineHeight", "()I", - (void*) nativeFocusCandidateLineHeight }, - { "nativeFocusCandidateMaxLength", "()I", - (void*) nativeFocusCandidateMaxLength }, - { "nativeFocusCandidateIsAutoComplete", "()Z", - (void*) nativeFocusCandidateIsAutoComplete }, - { "nativeFocusCandidateIsSpellcheck", "()Z", - (void*) nativeFocusCandidateIsSpellcheck }, - { "nativeFocusCandidateName", "()Ljava/lang/String;", - (void*) nativeFocusCandidateName }, - { "nativeFocusCandidateNodeBounds", "()Landroid/graphics/Rect;", - (void*) nativeFocusCandidateNodeBounds }, - { "nativeFocusCandidatePaddingRect", "()Landroid/graphics/Rect;", - (void*) nativeFocusCandidatePaddingRect }, - { "nativeFocusCandidatePointer", "()I", - (void*) nativeFocusCandidatePointer }, - { "nativeFocusCandidateText", "()Ljava/lang/String;", - (void*) nativeFocusCandidateText }, - { "nativeFocusCandidateTextSize", "()F", - (void*) nativeFocusCandidateTextSize }, - { "nativeFocusCandidateType", "()I", - (void*) nativeFocusCandidateType }, - { "nativeFocusCandidateLayerId", "()I", - (void*) nativeFocusCandidateLayerId }, - { "nativeFocusIsPlugin", "()Z", - (void*) nativeFocusIsPlugin }, - { "nativeFocusNodeBounds", "()Landroid/graphics/Rect;", - (void*) nativeFocusNodeBounds }, - { "nativeFocusNodePointer", "()I", - (void*) nativeFocusNodePointer }, - { "nativeGetCursorRingBounds", "()Landroid/graphics/Rect;", - (void*) nativeGetCursorRingBounds }, { "nativeGetSelection", "()Ljava/lang/String;", (void*) nativeGetSelection }, - { "nativeHasCursorNode", "()Z", - (void*) nativeHasCursorNode }, - { "nativeHasFocusNode", "()Z", - (void*) nativeHasFocusNode }, - { "nativeHideCursor", "()V", - (void*) nativeHideCursor }, - { "nativeImageURI", "(II)Ljava/lang/String;", - (void*) nativeImageURI }, { "nativeLayerBounds", "(I)Landroid/graphics/Rect;", (void*) nativeLayerBounds }, - { "nativeMotionUp", "(III)Z", - (void*) nativeMotionUp }, - { "nativeMoveCursor", "(IIZ)Z", - (void*) nativeMoveCursor }, - { "nativeMoveCursorToNextTextInput", "()Z", - (void*) nativeMoveCursorToNextTextInput }, - { "nativeMoveGeneration", "()I", - (void*) nativeMoveGeneration }, - { "nativePointInNavCache", "(III)Z", - (void*) nativePointInNavCache }, - { "nativeSelectBestAt", "(Landroid/graphics/Rect;)V", - (void*) nativeSelectBestAt }, - { "nativeSelectAt", "(II)V", - (void*) nativeSelectAt }, - { "nativeSetFindIsUp", "(Z)V", - (void*) nativeSetFindIsUp }, { "nativeSetHeightCanMeasure", "(Z)V", (void*) nativeSetHeightCanMeasure }, { "nativeSetBaseLayer", "(IILandroid/graphics/Region;ZZ)Z", @@ -1699,8 +1218,6 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeCopyBaseContentToPicture }, { "nativeHasContent", "()Z", (void*) nativeHasContent }, - { "nativeShowCursorTimed", "()V", - (void*) nativeShowCursorTimed }, { "nativeDiscardAllTextures", "()V", (void*) nativeDiscardAllTextures }, { "nativeTileProfilingStart", "()V", @@ -1721,12 +1238,6 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeStopGL }, { "nativeSubtractLayers", "(Landroid/graphics/Rect;)Landroid/graphics/Rect;", (void*) nativeSubtractLayers }, - { "nativeTextGeneration", "()I", - (void*) nativeTextGeneration }, - { "nativeUpdateCachedTextfield", "(Ljava/lang/String;I)V", - (void*) nativeUpdateCachedTextfield }, - { "nativeGetBlockLeftEdge", "(IIF)I", - (void*) nativeGetBlockLeftEdge }, { "nativeScrollableLayer", "(IILandroid/graphics/Rect;Landroid/graphics/Rect;)I", (void*) nativeScrollableLayer }, { "nativeScrollLayer", "(III)Z", @@ -1745,10 +1256,6 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeOnTrimMemory }, { "nativeSetPauseDrawing", "(IZ)V", (void*) nativeSetPauseDrawing }, - { "nativeDisableNavcache", "()Z", - (void*) nativeDisableNavcache }, - { "nativeFocusCandidateIsEditableText", "(I)Z", - (void*) nativeFocusCandidateIsEditableText }, { "nativeSetTextSelection", "(II)V", (void*) nativeSetTextSelection }, { "nativeGetHandleLayerId", "(IILandroid/graphics/Rect;)I", |