| 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.Handler; | 8 import android.os.Handler; |
| 9 import android.os.ResultReceiver; | 9 import android.os.ResultReceiver; |
| 10 import android.os.SystemClock; | 10 import android.os.SystemClock; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 /** | 54 /** |
| 55 * Interface for the delegate that needs to be notified of IME changes. | 55 * Interface for the delegate that needs to be notified of IME changes. |
| 56 */ | 56 */ |
| 57 public interface ImeAdapterDelegate { | 57 public interface ImeAdapterDelegate { |
| 58 /** | 58 /** |
| 59 * Called to notify the delegate about synthetic/real key events before
sending to renderer. | 59 * Called to notify the delegate about synthetic/real key events before
sending to renderer. |
| 60 */ | 60 */ |
| 61 void onImeEvent(); | 61 void onImeEvent(); |
| 62 | 62 |
| 63 /** | 63 /** |
| 64 * Called when a request to hide the keyboard is sent to InputMethodMana
ger. | |
| 65 */ | |
| 66 void onDismissInput(); | |
| 67 | |
| 68 /** | |
| 69 * Called when the keyboard could not be shown due to the hardware keybo
ard being present. | 64 * Called when the keyboard could not be shown due to the hardware keybo
ard being present. |
| 70 */ | 65 */ |
| 71 void onKeyboardBoundsUnchanged(); | 66 void onKeyboardBoundsUnchanged(); |
| 72 | 67 |
| 73 /** | 68 /** |
| 74 * @see BaseInputConnection#performContextMenuAction(int) | 69 * @see BaseInputConnection#performContextMenuAction(int) |
| 75 */ | 70 */ |
| 76 boolean performContextMenuAction(int id); | 71 boolean performContextMenuAction(int id); |
| 77 | 72 |
| 78 /** | 73 /** |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 277 } |
| 283 } | 278 } |
| 284 | 279 |
| 285 private void dismissInput(boolean unzoomIfNeeded) { | 280 private void dismissInput(boolean unzoomIfNeeded) { |
| 286 mIsShowWithoutHideOutstanding = false; | 281 mIsShowWithoutHideOutstanding = false; |
| 287 View view = mViewEmbedder.getAttachedView(); | 282 View view = mViewEmbedder.getAttachedView(); |
| 288 if (mInputMethodManagerWrapper.isActive(view)) { | 283 if (mInputMethodManagerWrapper.isActive(view)) { |
| 289 mInputMethodManagerWrapper.hideSoftInputFromWindow(view.getWindowTok
en(), 0, | 284 mInputMethodManagerWrapper.hideSoftInputFromWindow(view.getWindowTok
en(), 0, |
| 290 unzoomIfNeeded ? mViewEmbedder.getNewShowKeyboardReceiver()
: null); | 285 unzoomIfNeeded ? mViewEmbedder.getNewShowKeyboardReceiver()
: null); |
| 291 } | 286 } |
| 292 mViewEmbedder.onDismissInput(); | |
| 293 } | 287 } |
| 294 | 288 |
| 295 private boolean hasInputType() { | 289 private boolean hasInputType() { |
| 296 return mTextInputType != TextInputType.NONE; | 290 return mTextInputType != TextInputType.NONE; |
| 297 } | 291 } |
| 298 | 292 |
| 299 private static boolean isTextInputType(int type) { | 293 private static boolean isTextInputType(int type) { |
| 300 return type != TextInputType.NONE && !InputDialogContainer.isDialogInput
Type(type); | 294 return type != TextInputType.NONE && !InputDialogContainer.isDialogInput
Type(type); |
| 301 } | 295 } |
| 302 | 296 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 private native void nativeSetEditableSelectionOffsets(long nativeImeAdapterA
ndroid, | 623 private native void nativeSetEditableSelectionOffsets(long nativeImeAdapterA
ndroid, |
| 630 int start, int end); | 624 int start, int end); |
| 631 | 625 |
| 632 private native void nativeSetComposingRegion(long nativeImeAdapterAndroid, i
nt start, int end); | 626 private native void nativeSetComposingRegion(long nativeImeAdapterAndroid, i
nt start, int end); |
| 633 | 627 |
| 634 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid
, | 628 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid
, |
| 635 int before, int after); | 629 int before, int after); |
| 636 | 630 |
| 637 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); | 631 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); |
| 638 } | 632 } |
| OLD | NEW |