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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/input/ChromiumBaseInputConnection.java

Issue 1278593004: Introduce ThreadedInputConnection behind a switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding missing ImeTestUtils.java Created 4 years, 10 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 2016 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.content.browser.input;
6
7 import android.os.Handler;
8 import android.view.KeyEvent;
9 import android.view.View;
10 import android.view.inputmethod.EditorInfo;
11 import android.view.inputmethod.InputConnection;
12
13 import org.chromium.base.VisibleForTesting;
14
15 /**
16 * An interface to help switch between AdapterInputConnection and ChromiumInputC onnection.
17 */
18 public interface ChromiumBaseInputConnection extends InputConnection {
19 /**
20 * A factory class to create or reuse ChromiumBaseInputConnection.
21 */
22 public interface Factory {
23 ChromiumBaseInputConnection initializeAndGet(View view, ImeAdapter imeAd apter,
24 int inputType, int inputFlags, EditorInfo outAttrs);
25
26 @VisibleForTesting
27 Handler getHandler();
28 }
29
30 /**
31 * Updates the internal representation of the text being edited and its sele ction and
32 * composition properties.
33 *
34 * @param text The String contents of the field being edited.
35 * @param selectionStart The character offset of the selection start, or the caret position if
36 * there is no selection.
37 * @param selectionEnd The character offset of the selection end, or the car et position if there
38 * is no selection.
39 * @param compositionStart The character offset of the composition start, or -1 if there is no
40 * composition.
41 * @param compositionEnd The character offset of the composition end, or -1 if there is no
42 * selection.
43 * @param isNonImeChange True when the update was caused by non-IME (e.g. Ja vascript).
44 */
45 void updateStateOnUiThread(String text, int selectionStart, int selectionEnd ,
46 int compositionStart, int compositionEnd, boolean singleLine, boolea n isNonImeChange);
47
48 /**
49 * Send key event on UI thread.
50 * @param event A key event.
51 */
52 boolean sendKeyEventOnUiThread(KeyEvent event);
53
54 /**
55 * Call this when restartInput() is called.
56 */
57 void onRestartInputOnUiThread();
58
59 /**
60 * @return The {@link Handler} used for this InputConnection.
61 */
62 @VisibleForTesting
63 Handler getHandler();
64
65 /**
66 * Move cursor to the end of the current selection.
67 */
68 void moveCursorToSelectionEndOnUiThread();
69
70 /**
71 * Unblock thread function if needed, e.g. we found that we will
72 * never get state update.
73 */
74 void unblockOnUiThread();
75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698