Loading core/java/android/webkit/WebViewClassic.java +31 −12 Original line number Diff line number Diff line Loading @@ -1255,6 +1255,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc static final int AUTOFILL_FORM = 148; static final int ANIMATE_TEXT_SCROLL = 149; static final int EDIT_TEXT_SIZE_CHANGED = 150; static final int SHOW_CARET_HANDLE = 151; private static final int FIRST_PACKAGE_MSG_ID = SCROLL_TO_MSG_ID; private static final int LAST_PACKAGE_MSG_ID = HIT_TEST_RESULT; Loading Loading @@ -5468,9 +5469,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc private boolean setupWebkitSelect() { syncSelectionCursors(); if (mIsCaretSelection) { showPasteWindow(); } else if (!startSelectActionMode()) { if (!mIsCaretSelection && !startSelectActionMode()) { selectionDone(); return false; } Loading Loading @@ -5539,7 +5538,6 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc if (!mIsCaretSelection) { updateWebkitSelection(); } mIsCaretSelection = false; invalidate(); // redraw without selection mAutoScrollX = 0; mAutoScrollY = 0; Loading Loading @@ -6378,8 +6376,15 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc case MotionEvent.ACTION_UP: { mGestureDetector.onTouchEvent(ev); if (mTouchInEditText && mConfirmMove) { stopTouch(); break; // We've been scrolling the edit text. } if (!mConfirmMove && mIsEditingText && mSelectionStarted && mIsCaretSelection) { showPasteWindow(); stopTouch(); break; } // pass the touch events from UI thread to WebCore thread if (shouldForwardTouchEvent()) { TouchEventData ted = new TouchEventData(); Loading Loading @@ -6765,7 +6770,6 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc syncSelectionCursors(); if (mIsCaretSelection) { resetCaretTimer(); showPasteWindow(); } invalidate(); } Loading Loading @@ -8524,6 +8528,14 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc } break; case SHOW_CARET_HANDLE: if (!mSelectingText && mIsEditingText && mIsCaretSelection) { setupWebkitSelect(); resetCaretTimer(); showPasteWindow(); } break; default: super.handleMessage(msg); break; Loading Loading @@ -8823,6 +8835,12 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc (data.mStart != data.mEnd || (mFieldPointer == nodePointer && mFieldPointer != 0))) { mIsCaretSelection = (data.mStart == data.mEnd); if (mIsCaretSelection && (mInputConnection == null || mInputConnection.getEditable().length() == 0)) { // There's no text, don't show caret handle. selectionDone(); } else { if (!mSelectingText) { setupWebkitSelect(); } else if (!mSelectionStarted) { Loading @@ -8831,6 +8849,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc if (mIsCaretSelection) { resetCaretTimer(); } } } else { selectionDone(); } Loading core/java/android/webkit/WebViewCore.java +5 −2 Original line number Diff line number Diff line Loading @@ -1778,7 +1778,10 @@ public final class WebViewCore { case SELECT_WORD_AT: { int x = msg.arg1; int y = msg.arg2; nativeSelectWordAt(mNativeClass, x, y); if (!nativeSelectWordAt(mNativeClass, x, y)) { mWebView.mPrivateHandler.obtainMessage(WebViewClassic.SHOW_CARET_HANDLE) .sendToTarget(); } break; } case SELECT_ALL: Loading Loading @@ -3120,7 +3123,7 @@ public final class WebViewCore { private native void nativeSelectText(int nativeClass, int startX, int startY, int endX, int endY); private native void nativeClearTextSelection(int nativeClass); private native void nativeSelectWordAt(int nativeClass, int x, int y); private native boolean nativeSelectWordAt(int nativeClass, int x, int y); private native void nativeSelectAll(int nativeClass); private static native void nativeCertTrustChanged(); Loading Loading
core/java/android/webkit/WebViewClassic.java +31 −12 Original line number Diff line number Diff line Loading @@ -1255,6 +1255,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc static final int AUTOFILL_FORM = 148; static final int ANIMATE_TEXT_SCROLL = 149; static final int EDIT_TEXT_SIZE_CHANGED = 150; static final int SHOW_CARET_HANDLE = 151; private static final int FIRST_PACKAGE_MSG_ID = SCROLL_TO_MSG_ID; private static final int LAST_PACKAGE_MSG_ID = HIT_TEST_RESULT; Loading Loading @@ -5468,9 +5469,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc private boolean setupWebkitSelect() { syncSelectionCursors(); if (mIsCaretSelection) { showPasteWindow(); } else if (!startSelectActionMode()) { if (!mIsCaretSelection && !startSelectActionMode()) { selectionDone(); return false; } Loading Loading @@ -5539,7 +5538,6 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc if (!mIsCaretSelection) { updateWebkitSelection(); } mIsCaretSelection = false; invalidate(); // redraw without selection mAutoScrollX = 0; mAutoScrollY = 0; Loading Loading @@ -6378,8 +6376,15 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc case MotionEvent.ACTION_UP: { mGestureDetector.onTouchEvent(ev); if (mTouchInEditText && mConfirmMove) { stopTouch(); break; // We've been scrolling the edit text. } if (!mConfirmMove && mIsEditingText && mSelectionStarted && mIsCaretSelection) { showPasteWindow(); stopTouch(); break; } // pass the touch events from UI thread to WebCore thread if (shouldForwardTouchEvent()) { TouchEventData ted = new TouchEventData(); Loading Loading @@ -6765,7 +6770,6 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc syncSelectionCursors(); if (mIsCaretSelection) { resetCaretTimer(); showPasteWindow(); } invalidate(); } Loading Loading @@ -8524,6 +8528,14 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc } break; case SHOW_CARET_HANDLE: if (!mSelectingText && mIsEditingText && mIsCaretSelection) { setupWebkitSelect(); resetCaretTimer(); showPasteWindow(); } break; default: super.handleMessage(msg); break; Loading Loading @@ -8823,6 +8835,12 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc (data.mStart != data.mEnd || (mFieldPointer == nodePointer && mFieldPointer != 0))) { mIsCaretSelection = (data.mStart == data.mEnd); if (mIsCaretSelection && (mInputConnection == null || mInputConnection.getEditable().length() == 0)) { // There's no text, don't show caret handle. selectionDone(); } else { if (!mSelectingText) { setupWebkitSelect(); } else if (!mSelectionStarted) { Loading @@ -8831,6 +8849,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc if (mIsCaretSelection) { resetCaretTimer(); } } } else { selectionDone(); } Loading
core/java/android/webkit/WebViewCore.java +5 −2 Original line number Diff line number Diff line Loading @@ -1778,7 +1778,10 @@ public final class WebViewCore { case SELECT_WORD_AT: { int x = msg.arg1; int y = msg.arg2; nativeSelectWordAt(mNativeClass, x, y); if (!nativeSelectWordAt(mNativeClass, x, y)) { mWebView.mPrivateHandler.obtainMessage(WebViewClassic.SHOW_CARET_HANDLE) .sendToTarget(); } break; } case SELECT_ALL: Loading Loading @@ -3120,7 +3123,7 @@ public final class WebViewCore { private native void nativeSelectText(int nativeClass, int startX, int startY, int endX, int endY); private native void nativeClearTextSelection(int nativeClass); private native void nativeSelectWordAt(int nativeClass, int x, int y); private native boolean nativeSelectWordAt(int nativeClass, int x, int y); private native void nativeSelectAll(int nativeClass); private static native void nativeCertTrustChanged(); Loading