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

Unified Diff: components/spellcheck/browser/spellchecker_session_bridge_android.cc

Issue 2849933002: Store suggestions from Android spellchecker in spelling markers (Closed)
Patch Set: Created 3 years, 8 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 | « components/spellcheck/browser/spellchecker_session_bridge_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/spellcheck/browser/spellchecker_session_bridge_android.cc
diff --git a/components/spellcheck/browser/spellchecker_session_bridge_android.cc b/components/spellcheck/browser/spellchecker_session_bridge_android.cc
index de8b3f92550431c85c57a54cd6b64e5ded8ba549..68d20a3d1fd4628531312a9ec81422910ae5661f 100644
--- a/components/spellcheck/browser/spellchecker_session_bridge_android.cc
+++ b/components/spellcheck/browser/spellchecker_session_bridge_android.cc
@@ -94,7 +94,8 @@ void SpellCheckerSessionBridge::ProcessSpellCheckResults(
JNIEnv* env,
const JavaParamRef<jobject>& jobj,
const JavaParamRef<jintArray>& offset_array,
- const JavaParamRef<jintArray>& length_array) {
+ const JavaParamRef<jintArray>& length_array,
+ const JavaParamRef<jobjectArray>& suggestions_array) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
std::vector<int> offsets;
std::vector<int> lengths;
@@ -104,8 +105,14 @@ void SpellCheckerSessionBridge::ProcessSpellCheckResults(
std::vector<SpellCheckResult> results;
for (size_t i = 0; i < offsets.size(); i++) {
- results.push_back(
- SpellCheckResult(SpellCheckResult::SPELLING, offsets[i], lengths[i]));
+ base::android::ScopedJavaLocalRef<jobjectArray> suggestions_for_word_array(
+ env, static_cast<jobjectArray>(
+ env->GetObjectArrayElement(suggestions_array, i)));
+ std::vector<base::string16> suggestions_for_word;
+ base::android::AppendJavaStringArrayToStringVector(
+ env, suggestions_for_word_array.obj(), &suggestions_for_word);
+ results.push_back(SpellCheckResult(SpellCheckResult::SPELLING, offsets[i],
+ lengths[i], suggestions_for_word));
}
content::RenderProcessHost* sender =
« no previous file with comments | « components/spellcheck/browser/spellchecker_session_bridge_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698