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

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

Issue 1049993002: Get mojo_shell building inside chromium checkout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 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 package org.chromium.mojo.shell;
6
7 import android.app.Activity;
8 import android.content.Context;
9 import android.view.View;
10 import android.view.inputmethod.InputMethodManager;
11
12 import org.chromium.base.CalledByNative;
13 import org.chromium.base.JNINamespace;
14
15 /**
16 * Interaction with the keyboard.
17 */
18 @JNINamespace("mojo::shell")
19 public class Keyboard {
20 @CalledByNative
21 private static void showSoftKeyboard(Activity activity) {
22 View v = activity.getCurrentFocus();
23 InputMethodManager imm =
24 (InputMethodManager) activity.getSystemService(Context.INPUT_MET HOD_SERVICE);
25 imm.showSoftInput(v, InputMethodManager.SHOW_IMPLICIT);
26 }
27
28 @CalledByNative
29 private static void hideSoftKeyboard(Activity activity) {
30 View v = activity.getCurrentFocus();
31 InputMethodManager imm =
32 (InputMethodManager) activity.getSystemService(Context.INPUT_MET HOD_SERVICE);
33 imm.hideSoftInputFromWindow(v.getApplicationWindowToken(), 0);
34 }
35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698