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

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

Issue 643193003: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (C++ version) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Send ImeCompositionRangeChanged only when necessary Created 5 years, 10 months 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 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.annotation.TargetApi;
8 import android.os.Build;
7 import android.os.SystemClock; 9 import android.os.SystemClock;
8 import android.text.Editable; 10 import android.text.Editable;
9 import android.text.InputType; 11 import android.text.InputType;
10 import android.text.Selection; 12 import android.text.Selection;
11 import android.text.TextUtils; 13 import android.text.TextUtils;
12 import android.util.Log; 14 import android.util.Log;
13 import android.view.KeyCharacterMap; 15 import android.view.KeyCharacterMap;
14 import android.view.KeyEvent; 16 import android.view.KeyEvent;
15 import android.view.View; 17 import android.view.View;
16 import android.view.inputmethod.BaseInputConnection; 18 import android.view.inputmethod.BaseInputConnection;
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 } 546 }
545 updateSelectionIfRequired(); 547 updateSelectionIfRequired();
546 548
547 CharSequence regionText = null; 549 CharSequence regionText = null;
548 if (b > a) { 550 if (b > a) {
549 regionText = mEditable.subSequence(a, b); 551 regionText = mEditable.subSequence(a, b);
550 } 552 }
551 return mImeAdapter.setComposingRegion(regionText, a, b); 553 return mImeAdapter.setComposingRegion(regionText, a, b);
552 } 554 }
553 555
556 /**
557 * @see BaseInputConnection#requestCursorUpdates(int)
558 */
559 @TargetApi(Build.VERSION_CODES.LOLLIPOP)
560 @Override
561 public boolean requestCursorUpdates(int cursorUpdateMode) {
562 return mImeAdapter.requestCursorUpdates(cursorUpdateMode);
563 }
564
554 boolean isActive() { 565 boolean isActive() {
555 return getInputMethodManagerWrapper().isActive(mInternalView); 566 return getInputMethodManagerWrapper().isActive(mInternalView);
556 } 567 }
557 568
558 private InputMethodManagerWrapper getInputMethodManagerWrapper() { 569 private InputMethodManagerWrapper getInputMethodManagerWrapper() {
559 return mImeAdapter.getInputMethodManagerWrapper(); 570 return mImeAdapter.getInputMethodManagerWrapper();
560 } 571 }
561 572
562 /** 573 /**
563 * This method works around the issue crbug.com/373934 where Blink does not cancel 574 * This method works around the issue crbug.com/373934 where Blink does not cancel
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 @VisibleForTesting 618 @VisibleForTesting
608 ImeState getImeStateForTesting() { 619 ImeState getImeStateForTesting() {
609 String text = mEditable.toString(); 620 String text = mEditable.toString();
610 int selectionStart = Selection.getSelectionStart(mEditable); 621 int selectionStart = Selection.getSelectionStart(mEditable);
611 int selectionEnd = Selection.getSelectionEnd(mEditable); 622 int selectionEnd = Selection.getSelectionEnd(mEditable);
612 int compositionStart = getComposingSpanStart(mEditable); 623 int compositionStart = getComposingSpanStart(mEditable);
613 int compositionEnd = getComposingSpanEnd(mEditable); 624 int compositionEnd = getComposingSpanEnd(mEditable);
614 return new ImeState(text, selectionStart, selectionEnd, compositionStart , compositionEnd); 625 return new ImeState(text, selectionStart, selectionEnd, compositionStart , compositionEnd);
615 } 626 }
616 } 627 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698