| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // and forward to renderer along with input method results via | 24 // and forward to renderer along with input method results via |
| 25 // corresponding host view. | 25 // corresponding host view. |
| 26 // Ownership of these objects remains on the native side (see | 26 // Ownership of these objects remains on the native side (see |
| 27 // RenderWidgetHostViewAndroid). | 27 // RenderWidgetHostViewAndroid). |
| 28 class ImeAdapterAndroid { | 28 class ImeAdapterAndroid { |
| 29 public: | 29 public: |
| 30 explicit ImeAdapterAndroid(RenderWidgetHostViewAndroid* rwhva); | 30 explicit ImeAdapterAndroid(RenderWidgetHostViewAndroid* rwhva); |
| 31 ~ImeAdapterAndroid(); | 31 ~ImeAdapterAndroid(); |
| 32 | 32 |
| 33 // Called from java -> native | 33 // Called from java -> native |
| 34 // The java side is responsible to translate android KeyEvent various enums | |
| 35 // and values into the corresponding blink::WebInputEvent. | |
| 36 bool SendKeyEvent( | 34 bool SendKeyEvent( |
| 37 JNIEnv* env, | 35 JNIEnv* env, |
| 38 const base::android::JavaParamRef<jobject>&, | 36 const base::android::JavaParamRef<jobject>&, |
| 39 const base::android::JavaParamRef<jobject>& original_key_event, | 37 const base::android::JavaParamRef<jobject>& original_key_event, |
| 40 int action, | 38 int type, |
| 41 int meta_state, | 39 int modifiers, |
| 42 long event_time, | 40 long event_time, |
| 43 int key_code, | 41 int key_code, |
| 44 int scan_code, | 42 int scan_code, |
| 45 bool is_system_key, | 43 bool is_system_key, |
| 46 int unicode_text); | 44 int unicode_text); |
| 47 // |event_type| is a value of WebInputEvent::Type. | |
| 48 bool SendSyntheticKeyEvent(JNIEnv*, | |
| 49 const base::android::JavaParamRef<jobject>&, | |
| 50 int event_type, | |
| 51 long timestamp_ms, | |
| 52 int native_key_code, | |
| 53 int modifiers, | |
| 54 int unicode_char); | |
| 55 void SetComposingText(JNIEnv*, | 45 void SetComposingText(JNIEnv*, |
| 56 const base::android::JavaParamRef<jobject>& obj, | 46 const base::android::JavaParamRef<jobject>& obj, |
| 57 const base::android::JavaParamRef<jobject>& text, | 47 const base::android::JavaParamRef<jobject>& text, |
| 58 const base::android::JavaParamRef<jstring>& text_str, | 48 const base::android::JavaParamRef<jstring>& text_str, |
| 59 int new_cursor_pos); | 49 int new_cursor_pos); |
| 60 void CommitText(JNIEnv*, | 50 void CommitText(JNIEnv*, |
| 61 const base::android::JavaParamRef<jobject>&, | 51 const base::android::JavaParamRef<jobject>&, |
| 62 const base::android::JavaParamRef<jstring>& text_str); | 52 const base::android::JavaParamRef<jstring>& text_str); |
| 63 void FinishComposingText(JNIEnv* env, | 53 void FinishComposingText(JNIEnv* env, |
| 64 const base::android::JavaParamRef<jobject>&); | 54 const base::android::JavaParamRef<jobject>&); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 94 | 84 |
| 95 RenderWidgetHostViewAndroid* rwhva_; | 85 RenderWidgetHostViewAndroid* rwhva_; |
| 96 JavaObjectWeakGlobalRef java_ime_adapter_; | 86 JavaObjectWeakGlobalRef java_ime_adapter_; |
| 97 }; | 87 }; |
| 98 | 88 |
| 99 bool RegisterImeAdapter(JNIEnv* env); | 89 bool RegisterImeAdapter(JNIEnv* env); |
| 100 | 90 |
| 101 } // namespace content | 91 } // namespace content |
| 102 | 92 |
| 103 #endif // CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ | 93 #endif // CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ |
| OLD | NEW |