| Index: content/public/android/java/src/org/chromium/content/browser/input/ChromiumBaseInputConnectionFactory.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ChromiumBaseInputConnectionFactory.java b/content/public/android/java/src/org/chromium/content/browser/input/ChromiumBaseInputConnectionFactory.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..affcd024378c691c8dd3a6454f938a829e025628
|
| --- /dev/null
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/input/ChromiumBaseInputConnectionFactory.java
|
| @@ -0,0 +1,34 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.content.browser.input;
|
| +
|
| +import android.text.Editable;
|
| +import android.view.View;
|
| +import android.view.inputmethod.EditorInfo;
|
| +
|
| +import org.chromium.base.CommandLine;
|
| +import org.chromium.base.Log;
|
| +import org.chromium.base.ThreadUtils;
|
| +import org.chromium.content.common.ContentSwitches;
|
| +
|
| +/**
|
| + * Default factory for ChromiumBaseInputConnection classes.
|
| + */
|
| +public class ChromiumBaseInputConnectionFactory {
|
| + public ChromiumBaseInputConnection get(
|
| + View view, ImeAdapter imeAdapter, Editable editable, EditorInfo outAttrs) {
|
| + if (ThreadUtils.runningOnUiThread()) {
|
| + if (CommandLine.getInstance().hasSwitch(ContentSwitches.USE_IME_THREAD)) {
|
| + Log.w("cr.Ime", "getHandler() failed to detect input method handler creation.");
|
| + } else {
|
| + Log.d("cr.Ime", "Using the old AdapterInputConnection...");
|
| + }
|
| + return new AdapterInputConnection(view, imeAdapter, editable, outAttrs);
|
| + } else {
|
| + Log.d("cr.Ime", "Creating ChromiumInputConnection...");
|
| + return new ChromiumInputConnection(view, imeAdapter, outAttrs);
|
| + }
|
| + }
|
| +}
|
|
|