| Index: chrome/browser/spellchecker/spellcheck_message_filter_platform.h
|
| diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_platform.h b/chrome/browser/spellchecker/spellcheck_message_filter_platform.h
|
| index a632112734b42457585b725c12f53d7b976d3a3a..f927f8496de19aeb85f42cee01a8c162d6c9a530 100644
|
| --- a/chrome/browser/spellchecker/spellcheck_message_filter_platform.h
|
| +++ b/chrome/browser/spellchecker/spellcheck_message_filter_platform.h
|
| @@ -10,6 +10,10 @@
|
| #include "chrome/browser/spellchecker/spellcheck_message_filter.h"
|
| #include "chrome/common/spellcheck_result.h"
|
| #include "content/public/browser/browser_message_filter.h"
|
| +#include "base/android/jni_android.h"
|
| +#include "base/android/jni_array.h"
|
| +#include "base/android/jni_string.h"
|
| +
|
|
|
| // A message filter implementation that receives
|
| // the platform-specific spell checker requests from SpellCheckProvider.
|
| @@ -57,4 +61,40 @@ class SpellCheckMessageFilterPlatform : public content::BrowserMessageFilter {
|
| DISALLOW_COPY_AND_ASSIGN(SpellCheckMessageFilterPlatform);
|
| };
|
|
|
| +class SpellingRequest {
|
| + public:
|
| + SpellingRequest(content::BrowserMessageFilter* destination,
|
| + int render_process_id);
|
| +
|
| + void RequestCheck(const base::string16& text,
|
| + int route_id,
|
| + int identifier);
|
| +
|
| + void GetSpellcheckInfo(JNIEnv* env, jobject jobj, jobjectArray suggestionsArray,
|
| + jintArray offsetArray, jintArray lengthArray);
|
| + private:
|
| +
|
| + // Request a check for |text_| from local spell checker.
|
| + void RequestLocalCheck();
|
| +
|
| + // Check if all pending requests are done, send reply to render process if so.
|
| + void OnCheckCompleted();
|
| +
|
| + bool RegisterSpellingRequest(JNIEnv* env);
|
| +
|
| + std::vector<SpellCheckResult> local_results_;
|
| +
|
| + base::android::ScopedJavaGlobalRef<jobject> java_object_;
|
| +
|
| + // Barrier closure for completion of both remote and local check.
|
| + base::Closure completion_barrier_;
|
| +
|
| + content::BrowserMessageFilter* destination_; // ref-counted.
|
| + int render_process_id_;
|
| +
|
| + base::string16 text_;
|
| + int route_id_;
|
| + int identifier_;
|
| +};
|
| +
|
| #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_PLATFORM_H_
|
|
|