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.input; | 5 package org.chromium.content.browser.input; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.ClipData; | 8 import android.content.ClipData; |
9 import android.content.ClipboardManager; | 9 import android.content.ClipboardManager; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 + "<input id=\"input_text\" type=\"text\" /><br/></form><form>" | 51 + "<input id=\"input_text\" type=\"text\" /><br/></form><form>" |
52 + "<br/><input id=\"input_radio\" type=\"radio\" style=\"width:50px;
height:50px\" />" | 52 + "<br/><input id=\"input_radio\" type=\"radio\" style=\"width:50px;
height:50px\" />" |
53 + "<br/><textarea id=\"textarea\" rows=\"4\" cols=\"20\"></textarea>
" | 53 + "<br/><textarea id=\"textarea\" rows=\"4\" cols=\"20\"></textarea>
" |
54 + "<br/><textarea id=\"textarea2\" rows=\"4\" cols=\"20\" autocomple
te=\"off\">" | 54 + "<br/><textarea id=\"textarea2\" rows=\"4\" cols=\"20\" autocomple
te=\"off\">" |
55 + "</textarea>" | 55 + "</textarea>" |
56 + "<br/><input id=\"input_number1\" type=\"number\" /><br/>" | 56 + "<br/><input id=\"input_number1\" type=\"number\" /><br/>" |
57 + "<br/><input id=\"input_number2\" type=\"number\" /><br/>" | 57 + "<br/><input id=\"input_number2\" type=\"number\" /><br/>" |
58 + "<br/><p><span id=\"plain_text\">This is Plain Text One</span></p>
" | 58 + "<br/><p><span id=\"plain_text\">This is Plain Text One</span></p>
" |
59 + "</form></body></html>"); | 59 + "</form></body></html>"); |
60 | 60 |
61 private ChromiumBaseInputConnection mConnection; | 61 protected ChromiumBaseInputConnection mConnection; |
62 private TestInputConnectionFactory mConnectionFactory; | 62 private TestInputConnectionFactory mConnectionFactory; |
63 private ImeAdapter mImeAdapter; | 63 private ImeAdapter mImeAdapter; |
64 | 64 |
65 private ContentViewCore mContentViewCore; | 65 private ContentViewCore mContentViewCore; |
66 private WebContents mWebContents; | 66 private WebContents mWebContents; |
67 private TestCallbackHelperContainer mCallbackContainer; | 67 private TestCallbackHelperContainer mCallbackContainer; |
68 private TestInputMethodManagerWrapper mInputMethodManagerWrapper; | 68 protected TestInputMethodManagerWrapper mInputMethodManagerWrapper; |
69 | 69 |
70 @Override | 70 @Override |
71 public void setUp() throws Exception { | 71 public void setUp() throws Exception { |
72 super.setUp(); | 72 super.setUp(); |
73 | 73 |
74 launchContentShellWithUrl(DATA_URL); | 74 launchContentShellWithUrl(DATA_URL); |
75 waitForActiveShellToBeDoneLoading(); | 75 waitForActiveShellToBeDoneLoading(); |
76 mContentViewCore = getContentViewCore(); | 76 mContentViewCore = getContentViewCore(); |
77 mWebContents = getWebContents(); | 77 mWebContents = getWebContents(); |
78 | 78 |
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 private boolean setComposingRegion(final int start, final int end) throws Ex
ception { | 1254 private boolean setComposingRegion(final int start, final int end) throws Ex
ception { |
1255 final ChromiumBaseInputConnection connection = mConnection; | 1255 final ChromiumBaseInputConnection connection = mConnection; |
1256 return runBlockingOnImeThread(new Callable<Boolean>() { | 1256 return runBlockingOnImeThread(new Callable<Boolean>() { |
1257 @Override | 1257 @Override |
1258 public Boolean call() { | 1258 public Boolean call() { |
1259 return connection.setComposingRegion(start, end); | 1259 return connection.setComposingRegion(start, end); |
1260 } | 1260 } |
1261 }); | 1261 }); |
1262 } | 1262 } |
1263 | 1263 |
1264 private boolean setComposingText(final CharSequence text, final int newCurso
rPosition) | 1264 protected boolean setComposingText(final CharSequence text, final int newCur
sorPosition) |
1265 throws Exception { | 1265 throws Exception { |
1266 final ChromiumBaseInputConnection connection = mConnection; | 1266 final ChromiumBaseInputConnection connection = mConnection; |
1267 return runBlockingOnImeThread(new Callable<Boolean>() { | 1267 return runBlockingOnImeThread(new Callable<Boolean>() { |
1268 @Override | 1268 @Override |
1269 public Boolean call() { | 1269 public Boolean call() { |
1270 return connection.setComposingText(text, newCursorPosition); | 1270 return connection.setComposingText(text, newCursorPosition); |
1271 } | 1271 } |
1272 }); | 1272 }); |
1273 } | 1273 } |
1274 | 1274 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 | 1401 |
1402 public void clearTextInputTypeHistory() { | 1402 public void clearTextInputTypeHistory() { |
1403 mTextInputTypeList.clear(); | 1403 mTextInputTypeList.clear(); |
1404 } | 1404 } |
1405 | 1405 |
1406 public EditorInfo getOutAttrs() { | 1406 public EditorInfo getOutAttrs() { |
1407 return mOutAttrs; | 1407 return mOutAttrs; |
1408 } | 1408 } |
1409 } | 1409 } |
1410 } | 1410 } |
OLD | NEW |