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 "base/android/jni_helper.h" | 10 #include "base/android/jni_helper.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
| 14 class RenderWidgetHostImpl; |
14 class RenderWidgetHostViewAndroid; | 15 class RenderWidgetHostViewAndroid; |
15 struct NativeWebKeyboardEvent; | 16 struct NativeWebKeyboardEvent; |
16 | 17 |
17 // This class is in charge of dispatching key events from the java side | 18 // This class is in charge of dispatching key events from the java side |
18 // and forward to renderer along with input method results via | 19 // and forward to renderer along with input method results via |
19 // corresponding host view. | 20 // corresponding host view. |
20 // Ownership of these objects remains on the native side (see | 21 // Ownership of these objects remains on the native side (see |
21 // RenderWidgetHostViewAndroid). | 22 // RenderWidgetHostViewAndroid). |
22 class ImeAdapterAndroid { | 23 class ImeAdapterAndroid { |
23 public: | 24 public: |
(...skipping 27 matching lines...) Expand all Loading... |
51 void SelectAll(JNIEnv*, jobject); | 52 void SelectAll(JNIEnv*, jobject); |
52 void Cut(JNIEnv*, jobject); | 53 void Cut(JNIEnv*, jobject); |
53 void Copy(JNIEnv*, jobject); | 54 void Copy(JNIEnv*, jobject); |
54 void Paste(JNIEnv*, jobject); | 55 void Paste(JNIEnv*, jobject); |
55 void ResetImeAdapter(JNIEnv*, jobject); | 56 void ResetImeAdapter(JNIEnv*, jobject); |
56 | 57 |
57 // Called from native -> java | 58 // Called from native -> java |
58 void CancelComposition(); | 59 void CancelComposition(); |
59 | 60 |
60 private: | 61 private: |
| 62 RenderWidgetHostImpl* GetRenderWidgetHostImpl(); |
| 63 |
61 RenderWidgetHostViewAndroid* rwhva_; | 64 RenderWidgetHostViewAndroid* rwhva_; |
62 JavaObjectWeakGlobalRef java_ime_adapter_; | 65 JavaObjectWeakGlobalRef java_ime_adapter_; |
63 }; | 66 }; |
64 | 67 |
65 bool RegisterImeAdapter(JNIEnv* env); | 68 bool RegisterImeAdapter(JNIEnv* env); |
66 | 69 |
67 } // namespace content | 70 } // namespace content |
68 | 71 |
69 #endif // CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ | 72 #endif // CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ |
OLD | NEW |