| 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_ANDROID_IME_UTILS_H_ | |
| 6 #define CONTENT_BROWSER_ANDROID_IME_UTILS_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 | |
| 10 class AndroidKeyEvent; | |
| 11 | |
| 12 namespace content { | |
| 13 | |
| 14 struct NativeWebKeyboardEvent; | |
| 15 | |
| 16 // Returns a java KeyEvent from a NativeWebKeyboardEvent, NULL if it fails. | |
| 17 jobject KeyEventFromNative(const NativeWebKeyboardEvent& event); | |
| 18 | |
| 19 // Maps a java KeyEvent into a NativeWebKeyboardEvent. | |
| 20 // |java_key_event| is used to maintain a globalref for KeyEvent. | |
| 21 // |action| will help determine the WebInputEvent type. | |
| 22 // type, |modifiers|, |time_ms|, |key_code|, |unicode_char| is used to create | |
| 23 // WebKeyboardEvent. |key_code| is also needed ad need to treat the enter key | |
| 24 // as a key press of character \r. | |
| 25 NativeWebKeyboardEvent NativeWebKeyboardEventFromKeyEvent( | |
| 26 JNIEnv* env, jobject java_key_event, int action, int modifiers, | |
| 27 long time_ms, int key_code, bool is_system_key, int unicode_char); | |
| 28 | |
| 29 } // namespace content | |
| 30 | |
| 31 #endif // CONTENT_BROWSER_ANDROID_IME_UTILS_H_ | |
| OLD | NEW |