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

Unified Diff: shell/android/apk/src/org/chromium/mojo/shell/Keyboard.java

Issue 1088793003: Expose sky KeyboardService in android mojo_shell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
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..82eed6b7649c004afd00d7c8e4307e87f0ab5928 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,31 @@
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.system.Core;
+import org.chromium.mojo.system.MessagePipeHandle;
+import org.chromium.mojo.system.UntypedHandle;
+import org.chromium.mojo.system.impl.CoreImpl;
+
+import org.domokit.keyboard.KeyboardServiceImpl;
+
/**
* 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);
}
}

Powered by Google App Engine
This is Rietveld 408576698