| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.content.res.Configuration; | 7 import android.content.res.Configuration; |
| 8 import android.os.Build; | 8 import android.os.Build; |
| 9 import android.os.ResultReceiver; | 9 import android.os.ResultReceiver; |
| 10 import android.os.SystemClock; | 10 import android.os.SystemClock; |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 public void resetAndHideKeyboard() { | 501 public void resetAndHideKeyboard() { |
| 502 if (DEBUG_LOGS) Log.w(TAG, "resetAndHideKeyboard"); | 502 if (DEBUG_LOGS) Log.w(TAG, "resetAndHideKeyboard"); |
| 503 mTextInputType = TextInputType.NONE; | 503 mTextInputType = TextInputType.NONE; |
| 504 mTextInputFlags = 0; | 504 mTextInputFlags = 0; |
| 505 mTextInputMode = WebTextInputMode.kDefault; | 505 mTextInputMode = WebTextInputMode.kDefault; |
| 506 // This will trigger unblocking if necessary. | 506 // This will trigger unblocking if necessary. |
| 507 hideKeyboard(); | 507 hideKeyboard(); |
| 508 } | 508 } |
| 509 | 509 |
| 510 /** | 510 /** |
| 511 * Call this when ImeAdapter gets destroyed. | |
| 512 */ | |
| 513 public void destroy() { | |
| 514 if (DEBUG_LOGS) Log.w(TAG, "destroy"); | |
| 515 resetAndHideKeyboard(); | |
| 516 if (mInputConnectionFactory != null) { | |
| 517 mInputConnectionFactory.destroy(); | |
| 518 } | |
| 519 } | |
| 520 | |
| 521 /** | |
| 522 * Update selection to input method manager. | 511 * Update selection to input method manager. |
| 523 * | 512 * |
| 524 * @param selectionStart The selection start. | 513 * @param selectionStart The selection start. |
| 525 * @param selectionEnd The selection end. | 514 * @param selectionEnd The selection end. |
| 526 * @param compositionStart The composition start. | 515 * @param compositionStart The composition start. |
| 527 * @param compositionEnd The composition end. | 516 * @param compositionEnd The composition end. |
| 528 */ | 517 */ |
| 529 void updateSelection( | 518 void updateSelection( |
| 530 int selectionStart, int selectionEnd, int compositionStart, int comp
ositionEnd) { | 519 int selectionStart, int selectionEnd, int compositionStart, int comp
ositionEnd) { |
| 531 mInputMethodManagerWrapper.updateSelection(mViewEmbedder.getAttachedView
(), | 520 mInputMethodManagerWrapper.updateSelection(mViewEmbedder.getAttachedView
(), |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 int start, int end); | 796 int start, int end); |
| 808 private native void nativeSetComposingRegion(long nativeImeAdapterAndroid, i
nt start, int end); | 797 private native void nativeSetComposingRegion(long nativeImeAdapterAndroid, i
nt start, int end); |
| 809 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid
, | 798 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid
, |
| 810 int before, int after); | 799 int before, int after); |
| 811 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); | 800 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); |
| 812 private native boolean nativeRequestTextInputStateUpdate(long nativeImeAdapt
erAndroid); | 801 private native boolean nativeRequestTextInputStateUpdate(long nativeImeAdapt
erAndroid); |
| 813 private native void nativeRequestCursorUpdate(long nativeImeAdapterAndroid, | 802 private native void nativeRequestCursorUpdate(long nativeImeAdapterAndroid, |
| 814 boolean immediateRequest, boolean monitorRequest); | 803 boolean immediateRequest, boolean monitorRequest); |
| 815 private native boolean nativeIsImeThreadEnabled(long nativeImeAdapterAndroid
); | 804 private native boolean nativeIsImeThreadEnabled(long nativeImeAdapterAndroid
); |
| 816 } | 805 } |
| OLD | NEW |