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

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

Issue 699333003: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move the core logic into Java side 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.content.Context; 7 import android.content.Context;
9 import android.os.Build; 8 import android.os.Build;
10 import android.os.IBinder; 9 import android.os.IBinder;
11 import android.os.ResultReceiver; 10 import android.os.ResultReceiver;
12 import android.view.View; 11 import android.view.View;
13 import android.view.inputmethod.CursorAnchorInfo; 12 import android.view.inputmethod.CursorAnchorInfo;
14 import android.view.inputmethod.InputMethodManager; 13 import android.view.inputmethod.InputMethodManager;
15 14
16 /** 15 /**
17 * Wrapper around Android's InputMethodManager 16 * Wrapper around Android's InputMethodManager
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 public void updateSelection(View view, int selStart, int selEnd, 61 public void updateSelection(View view, int selStart, int selEnd,
63 int candidatesStart, int candidatesEnd) { 62 int candidatesStart, int candidatesEnd) {
64 getInputMethodManager().updateSelection(view, selStart, selEnd, candidat esStart, 63 getInputMethodManager().updateSelection(view, selStart, selEnd, candidat esStart,
65 candidatesEnd); 64 candidatesEnd);
66 } 65 }
67 66
68 /** 67 /**
69 * @see android.view.inputmethod.InputMethodManager#updateCursorAnchorInfo(V iew, 68 * @see android.view.inputmethod.InputMethodManager#updateCursorAnchorInfo(V iew,
70 * CursorAnchorInfo) 69 * CursorAnchorInfo)
71 */ 70 */
72 @TargetApi(Build.VERSION_CODES.LOLLIPOP) 71 public void updateCursorAnchorInfo(View view, CursorAnchorInfoWrapper cursor AnchorInfo) {
73 public void updateCursorAnchorInfo(View view, CursorAnchorInfo cursorAnchorI nfo) { 72 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
jdduke (slow) 2015/02/09 17:01:17 Nit: No need for braces on these one liner early r
yukawa 2015/02/10 17:24:54 Done.
74 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 73 return;
75 getInputMethodManager().updateCursorAnchorInfo(view, cursorAnchorInf o);
76 } 74 }
75 if (cursorAnchorInfo == null) {
76 return;
77 }
78 Object realObject = cursorAnchorInfo.getObject();
79 if (!(realObject instanceof CursorAnchorInfo)) {
80 return;
81 }
82 getInputMethodManager().updateCursorAnchorInfo(view, (CursorAnchorInfo) realObject);
77 } 83 }
78 } 84 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698