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

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

Issue 1242613002: [Android] Supporting floating select ActionModes for web content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 302 }
303 303
304 private static boolean isTextInputType(int type) { 304 private static boolean isTextInputType(int type) {
305 return type != TextInputType.NONE && !InputDialogContainer.isDialogInput Type(type); 305 return type != TextInputType.NONE && !InputDialogContainer.isDialogInput Type(type);
306 } 306 }
307 307
308 public boolean hasTextInputType() { 308 public boolean hasTextInputType() {
309 return isTextInputType(mTextInputType); 309 return isTextInputType(mTextInputType);
310 } 310 }
311 311
312 /**
313 * @return true if the selected text is of password.
314 */
315 public boolean isSelectionPassword() {
316 return mTextInputType == TextInputType.PASSWORD;
317 }
318
319 public boolean dispatchKeyEvent(KeyEvent event) { 312 public boolean dispatchKeyEvent(KeyEvent event) {
320 Log.d(TAG, "dispatchKeyEvent: action [%d], keycode [%d]", event.getActio n(), 313 Log.d(TAG, "dispatchKeyEvent: action [%d], keycode [%d]", event.getActio n(),
321 event.getKeyCode()); 314 event.getKeyCode());
322 if (mInputConnection != null) { 315 if (mInputConnection != null) {
323 return mInputConnection.sendKeyEvent(event); 316 return mInputConnection.sendKeyEvent(event);
324 } 317 }
325 return translateAndSendNativeEvents(event); 318 return translateAndSendNativeEvents(event);
326 } 319 }
327 320
328 private int shouldSendKeyEventWithKeyCode(String text) { 321 private int shouldSendKeyEventWithKeyCode(String text) {
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 private native void nativeSetEditableSelectionOffsets(long nativeImeAdapterA ndroid, 631 private native void nativeSetEditableSelectionOffsets(long nativeImeAdapterA ndroid,
639 int start, int end); 632 int start, int end);
640 633
641 private native void nativeSetComposingRegion(long nativeImeAdapterAndroid, i nt start, int end); 634 private native void nativeSetComposingRegion(long nativeImeAdapterAndroid, i nt start, int end);
642 635
643 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid , 636 private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid ,
644 int before, int after); 637 int before, int after);
645 638
646 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid); 639 private native void nativeResetImeAdapter(long nativeImeAdapterAndroid);
647 } 640 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698