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..b2ce3297cc22dd808207b23875910336a55a7a82 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 |
@@ -106,6 +106,7 @@ public class SpellCheckerSessionBridge implements SpellCheckerSessionListener { |
ArrayList<Integer> offsets = new ArrayList<Integer>(); |
ArrayList<Integer> lengths = new ArrayList<Integer>(); |
+ ArrayList<String[]> suggestions = new ArrayList<String[]>(); |
for (SentenceSuggestionsInfo result : results) { |
if (result == null) { |
@@ -121,11 +122,19 @@ public class SpellCheckerSessionBridge implements SpellCheckerSessionListener { |
== SuggestionsInfo.RESULT_ATTR_LOOKS_LIKE_TYPO) { |
offsets.add(result.getOffsetAt(i)); |
lengths.add(result.getLengthAt(i)); |
+ SuggestionsInfo info = result.getSuggestionsInfoAt(i); |
+ ArrayList<String> suggestions_for_word = new ArrayList<String>(); |
+ for (int j = 0; j < info.getSuggestionsCount(); ++j) { |
+ suggestions_for_word.add(info.getSuggestionAt(j)); |
+ } |
+ suggestions.add( |
+ suggestions_for_word.toArray(new String[suggestions_for_word.size()])); |
} |
} |
} |
nativeProcessSpellCheckResults(mNativeSpellCheckerSessionBridge, |
- convertListToArray(offsets), convertListToArray(lengths)); |
+ convertListToArray(offsets), convertListToArray(lengths), |
+ suggestions.toArray(new String[suggestions.size()][])); |
RecordHistogram.recordTimesHistogram("SpellCheck.Android.Latency", |
mStopMs - mStartMs, TimeUnit.MILLISECONDS); |
@@ -147,6 +156,6 @@ public class SpellCheckerSessionBridge implements SpellCheckerSessionListener { |
@Override |
public void onGetSuggestions(SuggestionsInfo[] results) {} |
- private native void nativeProcessSpellCheckResults( |
- long nativeSpellCheckerSessionBridge, int[] offsets, int[] lengths); |
+ private native void nativeProcessSpellCheckResults(long nativeSpellCheckerSessionBridge, |
+ int[] offsets, int[] lengths, String[][] suggestions); |
} |