| Index: content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java b/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java
|
| index 673a3740925a1196b1510e37e49277531ec95aec..83405040396590135b1a117ea0f8db0bf6542d87 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java
|
| @@ -22,12 +22,13 @@ import java.lang.reflect.Method;
|
| * Wrapper around Android's InputMethodManager
|
| */
|
| public class InputMethodManagerWrapper {
|
| + private static final boolean DEBUG_LOGS = false;
|
| private static final String TAG = "cr_Ime";
|
|
|
| private final Context mContext;
|
|
|
| public InputMethodManagerWrapper(Context context) {
|
| - Log.d(TAG, "Constructor");
|
| + if (DEBUG_LOGS) Log.d(TAG, "Constructor");
|
| mContext = context;
|
| }
|
|
|
| @@ -39,7 +40,7 @@ public class InputMethodManagerWrapper {
|
| * @see android.view.inputmethod.InputMethodManager#restartInput(View)
|
| */
|
| public void restartInput(View view) {
|
| - Log.d(TAG, "restartInput");
|
| + if (DEBUG_LOGS) Log.d(TAG, "restartInput");
|
| getInputMethodManager().restartInput(view);
|
| }
|
|
|
| @@ -47,7 +48,7 @@ public class InputMethodManagerWrapper {
|
| * @see android.view.inputmethod.InputMethodManager#showSoftInput(View, int, ResultReceiver)
|
| */
|
| public void showSoftInput(View view, int flags, ResultReceiver resultReceiver) {
|
| - Log.d(TAG, "showSoftInput");
|
| + if (DEBUG_LOGS) Log.d(TAG, "showSoftInput");
|
| getInputMethodManager().showSoftInput(view, flags, resultReceiver);
|
| }
|
|
|
| @@ -56,7 +57,7 @@ public class InputMethodManagerWrapper {
|
| */
|
| public boolean isActive(View view) {
|
| final boolean active = getInputMethodManager().isActive(view);
|
| - Log.d(TAG, "isActive: " + active);
|
| + if (DEBUG_LOGS) Log.d(TAG, "isActive: " + active);
|
| return active;
|
| }
|
|
|
| @@ -65,7 +66,7 @@ public class InputMethodManagerWrapper {
|
| */
|
| public boolean hideSoftInputFromWindow(IBinder windowToken, int flags,
|
| ResultReceiver resultReceiver) {
|
| - Log.d(TAG, "hideSoftInputFromWindow");
|
| + if (DEBUG_LOGS) Log.d(TAG, "hideSoftInputFromWindow");
|
| return getInputMethodManager().hideSoftInputFromWindow(windowToken, flags, resultReceiver);
|
| }
|
|
|
| @@ -74,7 +75,7 @@ public class InputMethodManagerWrapper {
|
| */
|
| public void updateSelection(View view, int selStart, int selEnd,
|
| int candidatesStart, int candidatesEnd) {
|
| - Log.d(TAG, "updateSelection: SEL [%d, %d], COM [%d, %d]", selStart, selEnd,
|
| + if (DEBUG_LOGS) Log.d(TAG, "updateSelection: SEL [%d, %d], COM [%d, %d]", selStart, selEnd,
|
| candidatesStart, candidatesEnd);
|
| getInputMethodManager().updateSelection(view, selStart, selEnd, candidatesStart,
|
| candidatesEnd);
|
| @@ -86,7 +87,7 @@ public class InputMethodManagerWrapper {
|
| */
|
| @TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
| public void updateCursorAnchorInfo(View view, CursorAnchorInfo cursorAnchorInfo) {
|
| - Log.d(TAG, "updateCursorAnchorInfo");
|
| + if (DEBUG_LOGS) Log.d(TAG, "updateCursorAnchorInfo");
|
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
| getInputMethodManager().updateCursorAnchorInfo(view, cursorAnchorInfo);
|
| }
|
| @@ -99,14 +100,14 @@ public class InputMethodManagerWrapper {
|
| public void notifyUserAction() {
|
| // On N and above, this is not needed.
|
| if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) return;
|
| - Log.d(TAG, "notifyUserAction");
|
| + if (DEBUG_LOGS) Log.d(TAG, "notifyUserAction");
|
| InputMethodManager manager = getInputMethodManager();
|
| try {
|
| Method method = InputMethodManager.class.getMethod("notifyUserAction");
|
| method.invoke(manager);
|
| } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException
|
| | InvocationTargetException e) {
|
| - Log.d(TAG, "notifyUserAction failed");
|
| + if (DEBUG_LOGS) Log.d(TAG, "notifyUserAction failed");
|
| return;
|
| }
|
| }
|
|
|