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.test.util; | 5 package org.chromium.content.browser.test.util; |
6 | 6 |
7 import android.os.IBinder; | 7 import android.os.IBinder; |
8 import android.os.ResultReceiver; | 8 import android.os.ResultReceiver; |
9 import android.util.Pair; | 9 import android.util.Pair; |
10 import android.view.View; | 10 import android.view.View; |
(...skipping 21 matching lines...) Expand all Loading... | |
32 private InputConnection mInputConnection; | 32 private InputConnection mInputConnection; |
33 private int mRestartInputCounter; | 33 private int mRestartInputCounter; |
34 private int mShowSoftInputCounter; | 34 private int mShowSoftInputCounter; |
35 private int mHideSoftInputCounter; | 35 private int mHideSoftInputCounter; |
36 private final Range mSelection = new Range(-1, -1); | 36 private final Range mSelection = new Range(-1, -1); |
37 private final Range mComposition = new Range(-1, -1); | 37 private final Range mComposition = new Range(-1, -1); |
38 private boolean mIsShowWithoutHideOutstanding; | 38 private boolean mIsShowWithoutHideOutstanding; |
39 private final List<Pair<Range, Range>> mUpdateSelectionList; | 39 private final List<Pair<Range, Range>> mUpdateSelectionList; |
40 private int mUpdateCursorAnchorInfoCounter; | 40 private int mUpdateCursorAnchorInfoCounter; |
41 private CursorAnchorInfo mLastCursorAnchorInfo; | 41 private CursorAnchorInfo mLastCursorAnchorInfo; |
42 private int mImeOptions; | |
Changwan Ryu
2017/05/11 22:57:13
private final ArrayList<EditorInfo> mEditorInfoLis
AKVT
2017/05/12 13:26:25
Done.
| |
43 private int mInputType; | |
Changwan Ryu
2017/05/11 22:57:13
not needed at all. please remove all references.
AKVT
2017/05/12 13:26:25
Done.
| |
42 | 44 |
43 public TestInputMethodManagerWrapper(ContentViewCore contentViewCore) { | 45 public TestInputMethodManagerWrapper(ContentViewCore contentViewCore) { |
44 super(null); | 46 super(null); |
45 Log.d(TAG, "TestInputMethodManagerWrapper constructor"); | 47 Log.d(TAG, "TestInputMethodManagerWrapper constructor"); |
46 mContentViewCore = contentViewCore; | 48 mContentViewCore = contentViewCore; |
47 mUpdateSelectionList = new ArrayList<>(); | 49 mUpdateSelectionList = new ArrayList<>(); |
48 } | 50 } |
49 | 51 |
50 @Override | 52 @Override |
51 public void restartInput(View view) { | 53 public void restartInput(View view) { |
52 mRestartInputCounter++; | 54 mRestartInputCounter++; |
53 Log.d(TAG, "restartInput: count [%d]", mRestartInputCounter); | 55 Log.d(TAG, "restartInput: count [%d]", mRestartInputCounter); |
54 EditorInfo editorInfo = new EditorInfo(); | 56 EditorInfo editorInfo = new EditorInfo(); |
55 mInputConnection = mContentViewCore.onCreateInputConnection(editorInfo); | 57 mInputConnection = mContentViewCore.onCreateInputConnection(editorInfo); |
58 mImeOptions = editorInfo.imeOptions; | |
Changwan Ryu
2017/05/11 22:57:13
mEditorInfoList.add(editorInfo);
AKVT
2017/05/12 13:26:25
Done.
| |
59 mInputType = editorInfo.inputType; | |
56 } | 60 } |
57 | 61 |
58 @Override | 62 @Override |
59 public void showSoftInput(View view, int flags, ResultReceiver resultReceive r) { | 63 public void showSoftInput(View view, int flags, ResultReceiver resultReceive r) { |
60 mIsShowWithoutHideOutstanding = true; | 64 mIsShowWithoutHideOutstanding = true; |
61 mShowSoftInputCounter++; | 65 mShowSoftInputCounter++; |
62 Log.d(TAG, "showSoftInput: count [%d]", mShowSoftInputCounter); | 66 Log.d(TAG, "showSoftInput: count [%d]", mShowSoftInputCounter); |
63 if (mInputConnection != null) return; | 67 if (mInputConnection != null) return; |
64 EditorInfo editorInfo = new EditorInfo(); | 68 EditorInfo editorInfo = new EditorInfo(); |
65 mInputConnection = mContentViewCore.onCreateInputConnection(editorInfo); | 69 mInputConnection = mContentViewCore.onCreateInputConnection(editorInfo); |
70 mImeOptions = editorInfo.imeOptions; | |
Changwan Ryu
2017/05/11 22:57:13
mEditorInfoList.add(editorInfo);
AKVT
2017/05/12 13:26:25
Done.
| |
71 mInputType = editorInfo.inputType; | |
66 } | 72 } |
67 | 73 |
68 @Override | 74 @Override |
69 public boolean isActive(View view) { | 75 public boolean isActive(View view) { |
70 boolean result = mInputConnection != null; | 76 boolean result = mInputConnection != null; |
71 Log.d(TAG, "isActive: returns [%b]", result); | 77 Log.d(TAG, "isActive: returns [%b]", result); |
72 return result; | 78 return result; |
73 } | 79 } |
74 | 80 |
75 @Override | 81 @Override |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 | 136 |
131 public int getHideSoftInputCounter() { | 137 public int getHideSoftInputCounter() { |
132 return mHideSoftInputCounter; | 138 return mHideSoftInputCounter; |
133 } | 139 } |
134 | 140 |
135 public void reset() { | 141 public void reset() { |
136 Log.d(TAG, "reset"); | 142 Log.d(TAG, "reset"); |
137 mRestartInputCounter = 0; | 143 mRestartInputCounter = 0; |
138 mShowSoftInputCounter = 0; | 144 mShowSoftInputCounter = 0; |
139 mHideSoftInputCounter = 0; | 145 mHideSoftInputCounter = 0; |
140 mUpdateSelectionList.clear(); | 146 mUpdateSelectionList.clear(); |
Changwan Ryu
2017/05/11 22:57:13
Please add
mEditorInfoList.clear();
AKVT
2017/05/12 13:26:25
Done.
| |
141 } | 147 } |
142 | 148 |
143 public InputConnection getInputConnection() { | 149 public InputConnection getInputConnection() { |
144 return mInputConnection; | 150 return mInputConnection; |
145 } | 151 } |
146 | 152 |
147 public Range getSelection() { | 153 public Range getSelection() { |
148 return mSelection; | 154 return mSelection; |
149 } | 155 } |
150 | 156 |
(...skipping 10 matching lines...) Expand all Loading... | |
161 } | 167 } |
162 | 168 |
163 public void clearLastCursorAnchorInfo() { | 169 public void clearLastCursorAnchorInfo() { |
164 mLastCursorAnchorInfo = null; | 170 mLastCursorAnchorInfo = null; |
165 } | 171 } |
166 | 172 |
167 public CursorAnchorInfo getLastCursorAnchorInfo() { | 173 public CursorAnchorInfo getLastCursorAnchorInfo() { |
168 return mLastCursorAnchorInfo; | 174 return mLastCursorAnchorInfo; |
169 } | 175 } |
170 | 176 |
177 public int getImeOptions() { | |
Changwan Ryu
2017/05/11 22:57:13
public ArrayList<EditorInfo> getEditorInfoList() {
AKVT
2017/05/12 13:26:25
Done.
| |
178 return mImeOptions; | |
179 } | |
180 | |
181 public int getInputType() { | |
182 return mInputType; | |
183 } | |
184 | |
171 public void onUpdateSelection(Range oldSel, Range oldComp, Range newSel, Ran ge newComp) {} | 185 public void onUpdateSelection(Range oldSel, Range oldComp, Range newSel, Ran ge newComp) {} |
172 | 186 |
173 public void expectsSelectionOutsideComposition() {} | 187 public void expectsSelectionOutsideComposition() {} |
174 } | 188 } |
OLD | NEW |