| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser.input; | 5 package org.chromium.content.browser.input; |
| 6 | 6 |
| 7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.os.Build; | 9 import android.os.Build; |
| 10 import android.os.IBinder; | 10 import android.os.IBinder; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 public InputMethodManagerWrapper(Context context) { | 31 public InputMethodManagerWrapper(Context context) { |
| 32 if (DEBUG_LOGS) Log.i(TAG, "Constructor"); | 32 if (DEBUG_LOGS) Log.i(TAG, "Constructor"); |
| 33 mContext = context; | 33 mContext = context; |
| 34 } | 34 } |
| 35 | 35 |
| 36 private InputMethodManager getInputMethodManager() { | 36 private InputMethodManager getInputMethodManager() { |
| 37 return (InputMethodManager) mContext.getSystemService(Context.INPUT_METH
OD_SERVICE); | 37 return (InputMethodManager) mContext.getSystemService(Context.INPUT_METH
OD_SERVICE); |
| 38 } | 38 } |
| 39 | 39 |
| 40 public Context getContext() { |
| 41 return mContext; |
| 42 } |
| 43 |
| 40 /** | 44 /** |
| 41 * @see android.view.inputmethod.InputMethodManager#restartInput(View) | 45 * @see android.view.inputmethod.InputMethodManager#restartInput(View) |
| 42 */ | 46 */ |
| 43 public void restartInput(View view) { | 47 public void restartInput(View view) { |
| 44 if (DEBUG_LOGS) Log.i(TAG, "restartInput"); | 48 if (DEBUG_LOGS) Log.i(TAG, "restartInput"); |
| 45 getInputMethodManager().restartInput(view); | 49 getInputMethodManager().restartInput(view); |
| 46 } | 50 } |
| 47 | 51 |
| 48 /** | 52 /** |
| 49 * @see android.view.inputmethod.InputMethodManager#showSoftInput(View, int,
ResultReceiver) | 53 * @see android.view.inputmethod.InputMethodManager#showSoftInput(View, int,
ResultReceiver) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 try { | 123 try { |
| 120 Method method = InputMethodManager.class.getMethod("notifyUserAction
"); | 124 Method method = InputMethodManager.class.getMethod("notifyUserAction
"); |
| 121 method.invoke(manager); | 125 method.invoke(manager); |
| 122 } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumen
tException | 126 } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumen
tException |
| 123 | InvocationTargetException e) { | 127 | InvocationTargetException e) { |
| 124 if (DEBUG_LOGS) Log.i(TAG, "notifyUserAction failed"); | 128 if (DEBUG_LOGS) Log.i(TAG, "notifyUserAction failed"); |
| 125 return; | 129 return; |
| 126 } | 130 } |
| 127 } | 131 } |
| 128 } | 132 } |
| OLD | NEW |