Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Unified Diff: components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java

Issue 2914183003: Break SpellCheckerSessionBridge.onGetSentenceSuggestions() (Closed)
Patch Set: Fix build Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java
diff --git a/components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java b/components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java
index bcedb75bc3074c77a8b088216014863df548aea7..92fa3df46c198df0609c84a89a8ff235de6ae929 100644
--- a/components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java
+++ b/components/spellcheck/browser/android/java/src/org/chromium/components/spellcheck/SpellCheckerSessionBridge.java
@@ -15,10 +15,8 @@ import android.view.textservice.TextServicesManager;
import org.chromium.base.ContextUtils;
import org.chromium.base.annotations.CalledByNative;
-import org.chromium.base.metrics.RecordHistogram;
import java.util.ArrayList;
-import java.util.concurrent.TimeUnit;
/**
* JNI interface for native SpellCheckerSessionBridge to use Android's spellchecker.
@@ -98,37 +96,6 @@ public class SpellCheckerSessionBridge implements SpellCheckerSessionListener {
*/
@Override
public void onGetSentenceSuggestions(SentenceSuggestionsInfo[] results) {
- mStopMs = SystemClock.elapsedRealtime();
-
- if (mNativeSpellCheckerSessionBridge == 0) {
- return;
- }
-
- ArrayList<Integer> offsets = new ArrayList<Integer>();
- ArrayList<Integer> lengths = new ArrayList<Integer>();
-
- for (SentenceSuggestionsInfo result : results) {
- if (result == null) {
- // In some cases null can be returned by the selected spellchecking service,
- // see crbug.com/651458. In this case skip to next result to avoid a
- // NullPointerException later on.
- continue;
- }
- for (int i = 0; i < result.getSuggestionsCount(); i++) {
- // If a word looks like a typo, record its offset and length.
- if ((result.getSuggestionsInfoAt(i).getSuggestionsAttributes()
- & SuggestionsInfo.RESULT_ATTR_LOOKS_LIKE_TYPO)
- == SuggestionsInfo.RESULT_ATTR_LOOKS_LIKE_TYPO) {
- offsets.add(result.getOffsetAt(i));
- lengths.add(result.getLengthAt(i));
- }
- }
- }
- nativeProcessSpellCheckResults(mNativeSpellCheckerSessionBridge,
- convertListToArray(offsets), convertListToArray(lengths));
-
- RecordHistogram.recordTimesHistogram("SpellCheck.Android.Latency",
- mStopMs - mStartMs, TimeUnit.MILLISECONDS);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698