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

Unified Diff: services/keyboard/org/chromium/mojo/keyboard/KeyboardServiceImpl.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: services/keyboard/org/chromium/mojo/keyboard/KeyboardServiceImpl.java
diff --git a/sky/services/keyboard/org/domokit/keyboard/KeyboardServiceImpl.java b/services/keyboard/org/chromium/mojo/keyboard/KeyboardServiceImpl.java
similarity index 80%
rename from sky/services/keyboard/org/domokit/keyboard/KeyboardServiceImpl.java
rename to services/keyboard/org/chromium/mojo/keyboard/KeyboardServiceImpl.java
index 645cbf12efbb59f97a2751d2a85a4037bce6d8fe..36d53b717b4d954c0c0f167d579346d3db1cc9f0 100644
--- a/sky/services/keyboard/org/domokit/keyboard/KeyboardServiceImpl.java
+++ b/services/keyboard/org/chromium/mojo/keyboard/KeyboardServiceImpl.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.domokit.keyboard;
+package org.chromium.mojo.keyboard;
import android.content.Context;
import android.view.View;
@@ -25,6 +25,11 @@ public class KeyboardServiceImpl implements KeyboardService {
private Context mContext;
+ public KeyboardServiceImpl(Context context, MessagePipeHandle pipe) {
+ mContext = context;
+ KeyboardService.MANAGER.bind(this, pipe);
+ }
+
public KeyboardServiceImpl(Context context, Core core, MessagePipeHandle pipe) {
mContext = context;
@@ -36,13 +41,17 @@ public class KeyboardServiceImpl implements KeyboardService {
}
public static InputConnection createInputConnection(EditorInfo outAttrs) {
- if (sActiveClient == null)
- return null;
+ if (sActiveClient == null) return null;
return new InputConnectionAdaptor(sActiveView, sActiveClient, outAttrs);
}
@Override
- public void close() {}
+ public void close() {
+ if (sActiveClient != null) {
+ sActiveClient.close();
+ sActiveClient = null;
+ }
+ }
@Override
public void onConnectionError(MojoException e) {}
@@ -60,5 +69,7 @@ public class KeyboardServiceImpl implements KeyboardService {
InputMethodManager imm =
(InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(sActiveView.getApplicationWindowToken(), 0);
+ sActiveClient.close();
+ sActiveClient = null;
}
}
« no previous file with comments | « services/keyboard/org/chromium/mojo/keyboard/InputConnectionAdaptor.java ('k') | services/native_viewport/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698