Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: content/browser/android/ime_utils.cc

Issue 10831060: Refactor the Android port to allow access to the chrome layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gyp fixes Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 #include "content/browser/android/ime_utils.h"
6
7 #include <android/input.h>
8
9 #include "base/android/jni_android.h"
10 #include "content/public/browser/native_web_keyboard_event.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
12
13 namespace content {
14
15 jobject KeyEventFromNative(const NativeWebKeyboardEvent& event) {
16 return event.os_event;
17 }
18
19 NativeWebKeyboardEvent NativeWebKeyboardEventFromKeyEvent(
20 JNIEnv* env, jobject java_key_event, int action, int modifiers,
21 long time_ms, int key_code, bool is_system_key, int unicode_char) {
22 WebKit::WebInputEvent::Type type = WebKit::WebInputEvent::Undefined;
23 if (action == AKEY_EVENT_ACTION_DOWN)
24 type = WebKit::WebInputEvent::RawKeyDown;
25 else if (action == AKEY_EVENT_ACTION_UP)
26 type = WebKit::WebInputEvent::KeyUp;
27 return NativeWebKeyboardEvent(java_key_event, type, modifiers,
28 time_ms, key_code, unicode_char, is_system_key);
29 }
30
31 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698