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

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
« no previous file with comments | « shell/BUILD.gn ('k') | shell/android/keyboard_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « shell/BUILD.gn ('k') | shell/android/keyboard_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698