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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/ChromiumBaseInputConnectionFactory.java

Issue 1278593004: Introduce ThreadedInputConnection behind a switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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: 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);
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698