| Index: shell/android/apk/src/org/chromium/mojo/shell/Keyboard.java
|
| diff --git a/shell/android/apk/src/org/chromium/mojo/shell/Keyboard.java b/shell/android/apk/src/org/chromium/mojo/shell/Keyboard.java
|
| index 9c4875c739ab9a2b09ce76642808c9f854c9608b..2ee07dab45024ddfed6d9ebc88829b7dd552174d 100644
|
| --- a/shell/android/apk/src/org/chromium/mojo/shell/Keyboard.java
|
| +++ b/shell/android/apk/src/org/chromium/mojo/shell/Keyboard.java
|
| @@ -5,31 +5,30 @@
|
| package org.chromium.mojo.shell;
|
|
|
| import android.app.Activity;
|
| -import android.content.Context;
|
| import android.view.View;
|
| -import android.view.inputmethod.InputMethodManager;
|
|
|
| +import org.chromium.base.ApplicationStatus;
|
| import org.chromium.base.CalledByNative;
|
| import org.chromium.base.JNINamespace;
|
|
|
| +import org.chromium.mojo.keyboard.KeyboardServiceImpl;
|
| +import org.chromium.mojo.system.Core;
|
| +import org.chromium.mojo.system.MessagePipeHandle;
|
| +import org.chromium.mojo.system.UntypedHandle;
|
| +import org.chromium.mojo.system.impl.CoreImpl;
|
| +
|
| /**
|
| * Interaction with the keyboard.
|
| */
|
| @JNINamespace("shell")
|
| public class Keyboard {
|
| @CalledByNative
|
| - private static void showSoftKeyboard(Activity activity) {
|
| - View v = activity.getCurrentFocus();
|
| - InputMethodManager imm =
|
| - (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
|
| - imm.showSoftInput(v, InputMethodManager.SHOW_IMPLICIT);
|
| - }
|
| -
|
| - @CalledByNative
|
| - private static void hideSoftKeyboard(Activity activity) {
|
| + public static void createKeyboardImpl(Activity activity, int keyboardRequestHandleValue) {
|
| + Core core = CoreImpl.getInstance();
|
| + UntypedHandle keyboardRequestHandle = core.acquireNativeHandle(keyboardRequestHandleValue);
|
| + MessagePipeHandle keyboardRequest = keyboardRequestHandle.toMessagePipeHandle();
|
| View v = activity.getCurrentFocus();
|
| - InputMethodManager imm =
|
| - (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
|
| - imm.hideSoftInputFromWindow(v.getApplicationWindowToken(), 0);
|
| + new KeyboardServiceImpl(ApplicationStatus.getApplicationContext(), keyboardRequest);
|
| + KeyboardServiceImpl.setActiveView(v);
|
| }
|
| }
|
|
|