OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.support.annotation.IntDef; | 7 import android.support.annotation.IntDef; |
8 import android.text.TextUtils; | 8 import android.text.TextUtils; |
9 | 9 |
10 import org.chromium.base.annotations.CalledByNative; | 10 import org.chromium.base.annotations.CalledByNative; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 @Override | 91 @Override |
92 public void cancelAllRequests() { | 92 public void cancelAllRequests() { |
93 if (mNativeSmartSelectionClient != 0) { | 93 if (mNativeSmartSelectionClient != 0) { |
94 nativeCancelAllRequests(mNativeSmartSelectionClient); | 94 nativeCancelAllRequests(mNativeSmartSelectionClient); |
95 } | 95 } |
96 | 96 |
97 mProvider.cancelAllRequests(); | 97 mProvider.cancelAllRequests(); |
98 } | 98 } |
99 | 99 |
| 100 @Override |
| 101 public void selectWordAroundCaretAck(boolean didSelect, int startAdjust, int
endAdjust) {} |
| 102 |
100 private void requestSurroundingText(@RequestType int callbackData) { | 103 private void requestSurroundingText(@RequestType int callbackData) { |
101 if (mNativeSmartSelectionClient == 0) { | 104 if (mNativeSmartSelectionClient == 0) { |
102 onSurroundingTextReceived(callbackData, "", 0, 0); | 105 onSurroundingTextReceived(callbackData, "", 0, 0); |
103 return; | 106 return; |
104 } | 107 } |
105 | 108 |
106 nativeRequestSurroundingText(mNativeSmartSelectionClient, NUM_EXTRA_CHAR
S, callbackData); | 109 nativeRequestSurroundingText(mNativeSmartSelectionClient, NUM_EXTRA_CHAR
S, callbackData); |
107 } | 110 } |
108 | 111 |
109 @CalledByNative | 112 @CalledByNative |
(...skipping 17 matching lines...) Expand all Loading... |
127 assert false : "Unexpected callback data"; | 130 assert false : "Unexpected callback data"; |
128 break; | 131 break; |
129 } | 132 } |
130 } | 133 } |
131 | 134 |
132 private native long nativeInit(WebContents webContents); | 135 private native long nativeInit(WebContents webContents); |
133 private native void nativeRequestSurroundingText( | 136 private native void nativeRequestSurroundingText( |
134 long nativeSmartSelectionClient, int numExtraCharacters, int callbac
kData); | 137 long nativeSmartSelectionClient, int numExtraCharacters, int callbac
kData); |
135 private native void nativeCancelAllRequests(long nativeSmartSelectionClient)
; | 138 private native void nativeCancelAllRequests(long nativeSmartSelectionClient)
; |
136 } | 139 } |
OLD | NEW |