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

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

Issue 1209713002: [Android] Use WebContents text manipulation methods directly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix null check Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
index 182e6d88e2cead40d9e3b048b9cd1e588d2e55dd..d97d4860fb5e2a8721a9fb9895dd696377441f51 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
@@ -71,6 +71,11 @@ public class ImeAdapter {
void onKeyboardBoundsUnchanged();
/**
+ * @see BaseInputConnection#performContextMenuAction(int)
+ */
+ boolean performContextMenuAction(int id);
+
+ /**
* @return View that the keyboard should be attached to.
*/
View getAttachedView();
@@ -351,6 +356,13 @@ public class ImeAdapter {
return null; // No printing characters were found.
}
+ /**
+ * @see BaseInputConnection#performContextMenuAction(int)
+ */
+ public boolean performContextMenuAction(int id) {
+ return mViewEmbedder.performContextMenuAction(id);
+ }
+
@VisibleForTesting
public static KeyEvent getTypedKeyEventGuess(String oldtext, String newtext) {
// Starting typing a new composition should add only a single character. Any composition
@@ -554,56 +566,6 @@ public class ImeAdapter {
return true;
}
- /**
- * Send a request to the native counterpart to unselect text.
- * @return Whether the native counterpart of ImeAdapter received the call.
- */
- public boolean unselect() {
- if (mNativeImeAdapterAndroid == 0) return false;
- nativeUnselect(mNativeImeAdapterAndroid);
- return true;
- }
-
- /**
- * Send a request to the native counterpart of ImeAdapter to select all the text.
- * @return Whether the native counterpart of ImeAdapter received the call.
- */
- public boolean selectAll() {
- if (mNativeImeAdapterAndroid == 0) return false;
- nativeSelectAll(mNativeImeAdapterAndroid);
- return true;
- }
-
- /**
- * Send a request to the native counterpart of ImeAdapter to cut the selected text.
- * @return Whether the native counterpart of ImeAdapter received the call.
- */
- public boolean cut() {
- if (mNativeImeAdapterAndroid == 0) return false;
- nativeCut(mNativeImeAdapterAndroid);
- return true;
- }
-
- /**
- * Send a request to the native counterpart of ImeAdapter to copy the selected text.
- * @return Whether the native counterpart of ImeAdapter received the call.
- */
- public boolean copy() {
- if (mNativeImeAdapterAndroid == 0) return false;
- nativeCopy(mNativeImeAdapterAndroid);
- return true;
- }
-
- /**
- * Send a request to the native counterpart of ImeAdapter to paste the text from the clipboard.
- * @return Whether the native counterpart of ImeAdapter received the call.
- */
- public boolean paste() {
- if (mNativeImeAdapterAndroid == 0) return false;
- nativePaste(mNativeImeAdapterAndroid);
- return true;
- }
-
// Calls from C++ to Java
@CalledByNative
@@ -672,10 +634,5 @@ public class ImeAdapter {
private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid,
int before, int after);
- private native void nativeUnselect(long nativeImeAdapterAndroid);
- private native void nativeSelectAll(long nativeImeAdapterAndroid);
- private native void nativeCut(long nativeImeAdapterAndroid);
- private native void nativeCopy(long nativeImeAdapterAndroid);
- private native void nativePaste(long nativeImeAdapterAndroid);
private native void nativeResetImeAdapter(long nativeImeAdapterAndroid);
}

Powered by Google App Engine
This is Rietveld 408576698