OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 namespace content { |
| 11 |
| 12 class RenderWidgetHostViewAndroid; |
| 13 struct NativeWebKeyboardEvent; |
| 14 |
| 15 // This class is in charge of dispatching key events from the java side |
| 16 // and forward to renderer along with input method results via |
| 17 // corresponding host view. |
| 18 class ImeAdapterAndroid { |
| 19 public: |
| 20 explicit ImeAdapterAndroid(RenderWidgetHostViewAndroid* rwhva); |
| 21 ~ImeAdapterAndroid(); |
| 22 |
| 23 static bool RegisterImeAdapter(JNIEnv* env); |
| 24 |
| 25 // Called from java -> native |
| 26 // The java side is responsible to translate android KeyEvent various enums |
| 27 // and values into the corresponding WebKit::WebInputEvent. |
| 28 void Unselect(JNIEnv*, jobject); |
| 29 void SelectAll(JNIEnv*, jobject); |
| 30 void Cut(JNIEnv*, jobject); |
| 31 void Copy(JNIEnv*, jobject); |
| 32 void Paste(JNIEnv*, jobject); |
| 33 |
| 34 private: |
| 35 RenderWidgetHostViewAndroid* rwhva_; |
| 36 jobject java_ime_adapter_; |
| 37 }; |
| 38 |
| 39 } // namespace content |
| 40 |
| 41 #endif // CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ |
OLD | NEW |