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

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

Issue 371133004: Update isSelectionEditable to be more broadly useful. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using separate isFocusedNodeEditable instead of changing isSelectionEditable. Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698