| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_SPELLCHECK_BROWSER_SPELLCHECKER_SESSION_BRIDGE_ANDROID_H_ | 5 #ifndef COMPONENTS_SPELLCHECK_BROWSER_SPELLCHECKER_SESSION_BRIDGE_ANDROID_H_ |
| 6 #define COMPONENTS_SPELLCHECK_BROWSER_SPELLCHECKER_SESSION_BRIDGE_ANDROID_H_ | 6 #define COMPONENTS_SPELLCHECK_BROWSER_SPELLCHECKER_SESSION_BRIDGE_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 void RequestTextCheck(int route_id, | 28 void RequestTextCheck(int route_id, |
| 29 int identifier, | 29 int identifier, |
| 30 const base::string16& text); | 30 const base::string16& text); |
| 31 | 31 |
| 32 // Receives information from Java side about the typos in a given string | 32 // Receives information from Java side about the typos in a given string |
| 33 // of text, processes these and sends them to the renderer. | 33 // of text, processes these and sends them to the renderer. |
| 34 void ProcessSpellCheckResults( | 34 void ProcessSpellCheckResults( |
| 35 JNIEnv* env, | 35 JNIEnv* env, |
| 36 const base::android::JavaParamRef<jobject>& jobj, | 36 const base::android::JavaParamRef<jobject>& jobj, |
| 37 const base::android::JavaParamRef<jintArray>& offset_array, | 37 const base::android::JavaParamRef<jintArray>& offset_array, |
| 38 const base::android::JavaParamRef<jintArray>& length_array); | 38 const base::android::JavaParamRef<jintArray>& length_array, |
| 39 const base::android::JavaParamRef<jobjectArray>& suggestions_array); |
| 39 | 40 |
| 40 // Sets the handle to the Java SpellCheckerSessionBridge object to null, | 41 // Sets the handle to the Java SpellCheckerSessionBridge object to null, |
| 41 // marking the Java object for garbage collection. | 42 // marking the Java object for garbage collection. |
| 42 void DisconnectSession(); | 43 void DisconnectSession(); |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 struct SpellingRequest { | 46 struct SpellingRequest { |
| 46 SpellingRequest(int route_id, int identifier, const base::string16& text); | 47 SpellingRequest(int route_id, int identifier, const base::string16& text); |
| 47 ~SpellingRequest(); | 48 ~SpellingRequest(); |
| 48 | 49 |
| 49 int route_id; | 50 int route_id; |
| 50 int identifier; | 51 int identifier; |
| 51 base::string16 text; | 52 base::string16 text; |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 int render_process_id_; | 55 int render_process_id_; |
| 55 | 56 |
| 56 std::unique_ptr<SpellingRequest> active_request_; | 57 std::unique_ptr<SpellingRequest> active_request_; |
| 57 std::unique_ptr<SpellingRequest> pending_request_; | 58 std::unique_ptr<SpellingRequest> pending_request_; |
| 58 | 59 |
| 59 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 60 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 60 bool java_object_initialization_failed_; | 61 bool java_object_initialization_failed_; |
| 61 bool active_session_; | 62 bool active_session_; |
| 62 | 63 |
| 63 DISALLOW_COPY_AND_ASSIGN(SpellCheckerSessionBridge); | 64 DISALLOW_COPY_AND_ASSIGN(SpellCheckerSessionBridge); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 #endif // COMPONENTS_SPELLCHECK_BROWSER_SPELLCHECKER_SESSION_BRIDGE_ANDROID_H_ | 67 #endif // COMPONENTS_SPELLCHECK_BROWSER_SPELLCHECKER_SESSION_BRIDGE_ANDROID_H_ |
| OLD | NEW |