OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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.input; | 5 package org.chromium.content.browser.input; |
6 | 6 |
7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
8 import android.app.Activity; | 8 import android.app.Activity; |
9 import android.content.ClipData; | 9 import android.content.ClipData; |
10 import android.content.ClipboardManager; | 10 import android.content.ClipboardManager; |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 int restartCount = mInputMethodManagerWrapper.getRestartInputCounter(); | 190 int restartCount = mInputMethodManagerWrapper.getRestartInputCounter(); |
191 Integer[] history = mConnectionFactory.getTextInputTypeHistory(); | 191 Integer[] history = mConnectionFactory.getTextInputTypeHistory(); |
192 return stringifyKeyboardStates(showCount, hideCount, restartCount, histo
ry); | 192 return stringifyKeyboardStates(showCount, hideCount, restartCount, histo
ry); |
193 } | 193 } |
194 | 194 |
195 String stringifyKeyboardStates(int show, int hide, int restart, Integer[] hi
story) { | 195 String stringifyKeyboardStates(int show, int hide, int restart, Integer[] hi
story) { |
196 return "show count: " + show + ", hide count: " + hide + ", restart coun
t: " + restart | 196 return "show count: " + show + ", hide count: " + hide + ", restart coun
t: " + restart |
197 + ", input type history: " + Arrays.deepToString(history); | 197 + ", input type history: " + Arrays.deepToString(history); |
198 } | 198 } |
199 | 199 |
| 200 void performEditorAction(final int action) { |
| 201 final InputConnection inputConnection = mConnection; |
| 202 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| 203 @Override |
| 204 public void run() { |
| 205 inputConnection.performEditorAction(action); |
| 206 } |
| 207 }); |
| 208 } |
| 209 |
200 void performGo(TestCallbackHelperContainer testCallbackHelperContainer) thro
ws Throwable { | 210 void performGo(TestCallbackHelperContainer testCallbackHelperContainer) thro
ws Throwable { |
201 final InputConnection inputConnection = mConnection; | 211 final InputConnection inputConnection = mConnection; |
202 final Callable<Void> callable = new Callable<Void>() { | 212 final Callable<Void> callable = new Callable<Void>() { |
203 @Override | 213 @Override |
204 public Void call() throws Exception { | 214 public Void call() throws Exception { |
205 inputConnection.performEditorAction(EditorInfo.IME_ACTION_GO); | 215 inputConnection.performEditorAction(EditorInfo.IME_ACTION_GO); |
206 return null; | 216 return null; |
207 } | 217 } |
208 }; | 218 }; |
209 | 219 |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 public void onViewAttachedToWindow() { | 617 public void onViewAttachedToWindow() { |
608 mFactory.onViewAttachedToWindow(); | 618 mFactory.onViewAttachedToWindow(); |
609 } | 619 } |
610 | 620 |
611 @Override | 621 @Override |
612 public void onViewDetachedFromWindow() { | 622 public void onViewDetachedFromWindow() { |
613 mFactory.onViewDetachedFromWindow(); | 623 mFactory.onViewDetachedFromWindow(); |
614 } | 624 } |
615 } | 625 } |
616 } | 626 } |
OLD | NEW |