Chromium Code Reviews| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 409 * Call this when window's focus has changed. | 409 * Call this when window's focus has changed. |
| 410 * @param gainFocus True if we're gaining focus. | 410 * @param gainFocus True if we're gaining focus. |
| 411 */ | 411 */ |
| 412 public void onWindowFocusChanged(boolean gainFocus) { | 412 public void onWindowFocusChanged(boolean gainFocus) { |
| 413 if (mInputConnectionFactory != null) { | 413 if (mInputConnectionFactory != null) { |
| 414 mInputConnectionFactory.onWindowFocusChanged(gainFocus); | 414 mInputConnectionFactory.onWindowFocusChanged(gainFocus); |
| 415 } | 415 } |
| 416 } | 416 } |
| 417 | 417 |
| 418 /** | 418 /** |
| 419 * Call this when view is detached from window | 419 * Call this when view is attached to window. |
| 420 */ | 420 */ |
| 421 public void onViewAttachedToWindow() { | 421 public void onViewAttachedToWindow() { |
| 422 if (mInputConnectionFactory != null) { | 422 if (mInputConnectionFactory != null) { |
| 423 mInputConnectionFactory.onViewAttachedToWindow(); | 423 mInputConnectionFactory.onViewAttachedToWindow(); |
| 424 } | 424 } |
| 425 } | 425 } |
| 426 | 426 |
| 427 /** | 427 /** |
| 428 * Call this when view is detached from window | 428 * Call this when view is detached from window. |
| 429 */ | 429 */ |
| 430 public void onViewDetachedFromWindow() { | 430 public void onViewDetachedFromWindow() { |
| 431 resetAndHideKeyboard(); | 431 resetAndHideKeyboard(); |
| 432 if (mInputConnectionFactory != null) { | 432 if (mInputConnectionFactory != null) { |
| 433 mInputConnectionFactory.onViewDetachedFromWindow(); | 433 mInputConnectionFactory.onViewDetachedFromWindow(); |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 | 436 |
| 437 /** | 437 /** |
| 438 * Call this when view's focus has changed. | 438 * Call this when view's focus has changed. |
| 439 * @param gainFocus True if we're gaining focus. | 439 * @param gainFocus True if we're gaining focus. |
| 440 * @param hideKeyboardIfNeeded True if we should hide soft keyboard when los ing focus. | |
|
Changwan Ryu
2017/02/21 05:16:39
how about renaming this to hideKeyboardOnBlur?
yabinh
2017/02/21 06:18:31
Done.
| |
| 440 */ | 441 */ |
| 441 public void onViewFocusChanged(boolean gainFocus) { | 442 public void onViewFocusChanged(boolean gainFocus, boolean hideKeyboardIfNeed ed) { |
| 442 if (DEBUG_LOGS) Log.w(TAG, "onViewFocusChanged: gainFocus [%b]", gainFoc us); | 443 if (DEBUG_LOGS) Log.w(TAG, "onViewFocusChanged: gainFocus [%b]", gainFoc us); |
| 444 if (!gainFocus && hideKeyboardIfNeeded) resetAndHideKeyboard(); | |
| 443 if (mInputConnectionFactory != null) { | 445 if (mInputConnectionFactory != null) { |
| 444 mInputConnectionFactory.onViewFocusChanged(gainFocus); | 446 mInputConnectionFactory.onViewFocusChanged(gainFocus); |
| 445 } | 447 } |
| 446 } | 448 } |
| 447 | 449 |
| 448 /** | 450 /** |
| 449 * Move cursor to the end of the current selection. | 451 * Move cursor to the end of the current selection. |
| 450 */ | 452 */ |
| 451 public void moveCursorToSelectionEnd() { | 453 public void moveCursorToSelectionEnd() { |
| 452 if (DEBUG_LOGS) Log.w(TAG, "movecursorToEnd"); | 454 if (DEBUG_LOGS) Log.w(TAG, "movecursorToEnd"); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 779 private native void nativeSetEditableSelectionOffsets(long nativeImeAdapterA ndroid, | 781 private native void nativeSetEditableSelectionOffsets(long nativeImeAdapterA ndroid, |
| 780 int start, int end); | 782 int start, int end); |
| 781 private native void nativeSetComposingRegion(long nativeImeAdapterAndroid, i nt start, int end); | 783 private native void nativeSetComposingRegion(long nativeImeAdapterAndroid, i nt start, int end); |
| 782 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid , | 784 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid , |
| 783 int before, int after); | 785 int before, int after); |
| 784 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); | 786 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); |
| 785 private native boolean nativeRequestTextInputStateUpdate(long nativeImeAdapt erAndroid); | 787 private native boolean nativeRequestTextInputStateUpdate(long nativeImeAdapt erAndroid); |
| 786 private native void nativeRequestCursorUpdate(long nativeImeAdapterAndroid, | 788 private native void nativeRequestCursorUpdate(long nativeImeAdapterAndroid, |
| 787 boolean immediateRequest, boolean monitorRequest); | 789 boolean immediateRequest, boolean monitorRequest); |
| 788 } | 790 } |
| OLD | NEW |