Chromium Code Reviews| Index: chrome/browser/spellchecker/spellchecker_session_bridge_android.h |
| diff --git a/chrome/browser/spellchecker/spellchecker_session_bridge_android.h b/chrome/browser/spellchecker/spellchecker_session_bridge_android.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..44ee3ce7d7b6a7493819d3a8618e17a0319d9bc1 |
| --- /dev/null |
| +++ b/chrome/browser/spellchecker/spellchecker_session_bridge_android.h |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECKER_SESSION_BRIDGE_ANDROID_H_ |
| +#define CHROME_BROWSER_SPELLCHECKER_SPELLCHECKER_SESSION_BRIDGE_ANDROID_H_ |
| + |
| +#include "base/android/jni_android.h" |
| +#include "base/android/jni_array.h" |
|
newt (away)
2015/08/12 16:12:58
remove unneeded imports (jni_array.h and jni_strin
dylanking
2015/08/13 02:10:03
jni_array.h and jni_string.h are needed for the pa
|
| +#include "base/android/jni_string.h" |
| + |
| +// Owned by the SpellCheckMessageFilterPlatform. This class is used to |
| +// interface between the android message filter and the Java class of the |
| +// same name. This class is sent text to be spellchecked from |
| +// the message filter, then sends that text to the Java side via JNI to be |
| +// spellchecked, and finally processes those results and sends them to the |
| +// renderer. |
| +class SpellCheckerSessionBridge { |
| + public: |
| + explicit SpellCheckerSessionBridge(int render_process_id); |
| + ~SpellCheckerSessionBridge(); |
| + static bool RegisterSpellCheckerSessionBridge(JNIEnv* env); |
|
please use gerrit instead
2015/08/12 17:05:54
Where do you call this?
please use gerrit instead
2015/08/12 17:05:54
Since you've put this function inside of a class,
newt (away)
2015/08/12 20:08:35
Or call it "RegisterJNI", which is clear and conci
dylanking
2015/08/13 02:10:03
There's some information about this here, but I'm
|
| + |
| + // Receives text to be checked from the message filter and sends it to Java |
| + // to be spellchecked. |
| + void RequestTextCheck(int route_id, |
| + int identifier, |
| + const base::string16& text); |
| + |
| + // Receives information from Java side about the typos in a given string |
| + // of text, processes these and sends them to the renderer. |
| + void ProcessSpellCheckResults(JNIEnv* env, |
| + jobject jobj, |
| + jint route_id, |
| + jint identifier, |
| + jstring text, |
| + jintArray offsetArray, |
|
please use gerrit instead
2015/08/12 17:05:54
C++ parameters should_use_underscores_in_names.
dylanking
2015/08/13 02:10:03
Thanks, done.
|
| + jintArray lengthArray); |
| + |
| + private: |
| + int render_process_id_; |
| + base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SpellCheckerSessionBridge); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECKER_SESSION_BRIDGE_ANDROID_H_ |