diff options
Diffstat (limited to 'Source/WebKit/android/nav')
-rw-r--r-- | Source/WebKit/android/nav/SelectText.cpp | 14 | ||||
-rw-r--r-- | Source/WebKit/android/nav/SelectText.h | 24 | ||||
-rw-r--r-- | Source/WebKit/android/nav/WebView.cpp | 10 |
3 files changed, 8 insertions, 40 deletions
diff --git a/Source/WebKit/android/nav/SelectText.cpp b/Source/WebKit/android/nav/SelectText.cpp index 22c67bc..7ce32c3 100644 --- a/Source/WebKit/android/nav/SelectText.cpp +++ b/Source/WebKit/android/nav/SelectText.cpp @@ -144,17 +144,3 @@ void ReverseBidi(UChar* chars, int len) { } -namespace android { - -SelectText::HandleId SelectText::mapId(HandleId id) -{ - if (id == StartHandle || id == EndHandle) - return id; - if (isBaseFirst()) - return (HandleId) (id - 2); - if (id == BaseHandle) - return EndHandle; - return StartHandle; -} - -} diff --git a/Source/WebKit/android/nav/SelectText.h b/Source/WebKit/android/nav/SelectText.h index 50bc82e..aaaf3bb 100644 --- a/Source/WebKit/android/nav/SelectText.h +++ b/Source/WebKit/android/nav/SelectText.h @@ -35,32 +35,24 @@ namespace android { class SelectText : public RegionLayerDrawExtra { public: enum HandleId { - StartHandle = 0, - EndHandle = 1, - BaseHandle = 2, - ExtentHandle = 3, + LeftHandle = 0, + RightHandle = 1, }; - IntRect& caretRect(HandleId id) { return m_caretRects[mapId(id)]; } - void setCaretRect(HandleId id, const IntRect& rect) { m_caretRects[mapId(id)] = rect; } - IntRect& textRect(HandleId id) { return m_textRects[mapId(id)]; } - void setTextRect(HandleId id, const IntRect& rect) { m_textRects[mapId(id)] = rect; } - int caretLayerId(HandleId id) { return m_caretLayerId[mapId(id)]; } - void setCaretLayerId(HandleId id, int layerId) { m_caretLayerId[mapId(id)] = layerId; } - - bool isBaseFirst() const { return m_baseIsFirst; } - void setBaseFirst(bool isFirst) { m_baseIsFirst = isFirst; } + IntRect& caretRect(HandleId id) { return m_caretRects[id]; } + void setCaretRect(HandleId id, const IntRect& rect) { m_caretRects[id] = rect; } + IntRect& textRect(HandleId id) { return m_textRects[id]; } + void setTextRect(HandleId id, const IntRect& rect) { m_textRects[id] = rect; } + int caretLayerId(HandleId id) { return m_caretLayerId[id]; } + void setCaretLayerId(HandleId id, int layerId) { m_caretLayerId[id] = layerId; } void setText(const String& text) { m_text = text.threadsafeCopy(); } String& getText() { return m_text; } private: - HandleId mapId(HandleId id); - IntRect m_caretRects[2]; IntRect m_textRects[2]; int m_caretLayerId[2]; - bool m_baseIsFirst; String m_text; }; diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index a78392b..09e808b 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -1199,14 +1199,6 @@ static jint nativeGetHandleLayerId(JNIEnv *env, jobject obj, jint nativeView, return layerId; } -static jboolean nativeIsBaseFirst(JNIEnv *env, jobject obj, jint nativeView) -{ - WebView* webview = reinterpret_cast<WebView*>(nativeView); - SelectText* select = static_cast<SelectText*>( - webview->getDrawExtra(WebView::DrawExtrasSelection)); - return select ? select->isBaseFirst() : false; -} - static void nativeMapLayerRect(JNIEnv *env, jobject obj, jint nativeView, jint layerId, jobject rect) { @@ -1298,8 +1290,6 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeSetTextSelection }, { "nativeGetHandleLayerId", "(IILandroid/graphics/Point;Landroid/webkit/QuadF;)I", (void*) nativeGetHandleLayerId }, - { "nativeIsBaseFirst", "(I)Z", - (void*) nativeIsBaseFirst }, { "nativeMapLayerRect", "(IILandroid/graphics/Rect;)V", (void*) nativeMapLayerRect }, { "nativeSetHwAccelerated", "(IZ)I", |