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

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

Issue 2537073002: Fix leaks in InputConnectionHandlerThread (Closed)
Patch Set: fix tests Created 4 years 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
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
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 /**
511 * Update selection to input method manager. 522 * Update selection to input method manager.
512 * 523 *
513 * @param selectionStart The selection start. 524 * @param selectionStart The selection start.
514 * @param selectionEnd The selection end. 525 * @param selectionEnd The selection end.
515 * @param compositionStart The composition start. 526 * @param compositionStart The composition start.
516 * @param compositionEnd The composition end. 527 * @param compositionEnd The composition end.
517 */ 528 */
518 void updateSelection( 529 void updateSelection(
519 int selectionStart, int selectionEnd, int compositionStart, int comp ositionEnd) { 530 int selectionStart, int selectionEnd, int compositionStart, int comp ositionEnd) {
520 mInputMethodManagerWrapper.updateSelection(mViewEmbedder.getAttachedView (), 531 mInputMethodManagerWrapper.updateSelection(mViewEmbedder.getAttachedView (),
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 int start, int end); 807 int start, int end);
797 private native void nativeSetComposingRegion(long nativeImeAdapterAndroid, i nt start, int end); 808 private native void nativeSetComposingRegion(long nativeImeAdapterAndroid, i nt start, int end);
798 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid , 809 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid ,
799 int before, int after); 810 int before, int after);
800 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); 811 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid);
801 private native boolean nativeRequestTextInputStateUpdate(long nativeImeAdapt erAndroid); 812 private native boolean nativeRequestTextInputStateUpdate(long nativeImeAdapt erAndroid);
802 private native void nativeRequestCursorUpdate(long nativeImeAdapterAndroid, 813 private native void nativeRequestCursorUpdate(long nativeImeAdapterAndroid,
803 boolean immediateRequest, boolean monitorRequest); 814 boolean immediateRequest, boolean monitorRequest);
804 private native boolean nativeIsImeThreadEnabled(long nativeImeAdapterAndroid ); 815 private native boolean nativeIsImeThreadEnabled(long nativeImeAdapterAndroid );
805 } 816 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698