Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
index fb33b0c5e7d794af00a8e32294740461142841c6..fcdf5a00de0bd9b736101cd46e6061447203558a 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
@@ -287,7 +287,7 @@ public class ContentViewCore |
// whether the last selected text is still highlighted. |
private boolean mHasSelection; |
private String mLastSelectedText; |
- private boolean mSelectionEditable; |
+ private boolean mFocusedNodeEditable; |
private ActionMode mActionMode; |
private boolean mUnselectAllOnActionModeDismiss; |
@@ -1111,7 +1111,14 @@ public class ContentViewCore |
* @return Whether the current selection is editable (false if no text selected). |
*/ |
public boolean isSelectionEditable() { |
- return mHasSelection ? mSelectionEditable : false; |
+ return mHasSelection ? mFocusedNodeEditable : false; |
+ } |
+ |
+ /** |
+ * @return Whether the current focused node is editable. |
+ */ |
+ public boolean isFocusedNodeEditable() { |
+ return mFocusedNodeEditable; |
} |
// End FrameLayout overrides. |
@@ -1887,7 +1894,7 @@ public class ContentViewCore |
getInsertionHandleController().allowAutomaticShowing(); |
getSelectionHandleController().allowAutomaticShowing(); |
} else { |
- if (mSelectionEditable) getInsertionHandleController().allowAutomaticShowing(); |
+ if (mFocusedNodeEditable) getInsertionHandleController().allowAutomaticShowing(); |
} |
} |
@@ -2130,7 +2137,7 @@ public class ContentViewCore |
@Override |
public boolean isSelectionEditable() { |
- return mSelectionEditable; |
+ return mFocusedNodeEditable; |
} |
@Override |
@@ -2367,7 +2374,7 @@ public class ContentViewCore |
int compositionStart, int compositionEnd, boolean showImeIfNeeded, |
boolean isNonImeChange) { |
TraceEvent.begin(); |
- mSelectionEditable = (textInputType != ImeAdapter.getTextInputTypeNone()); |
+ mFocusedNodeEditable = (textInputType != ImeAdapter.getTextInputTypeNone()); |
mImeAdapter.updateKeyboardVisibility( |
nativeImeAdapterAndroid, textInputType, showImeIfNeeded); |
@@ -2497,7 +2504,7 @@ public class ContentViewCore |
} else { |
mUnselectAllOnActionModeDismiss = false; |
hideSelectActionBar(); |
- if (x1 != 0 && y1 != 0 && mSelectionEditable) { |
+ if (x1 != 0 && y1 != 0 && mFocusedNodeEditable) { |
// Selection is a caret, and a text field is focused. |
if (mSelectionHandleController != null) { |
mSelectionHandleController.hide(); |