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 b6e5580acc22588c3b1a8c5aa8532c54bf127cb1..8d45f21bb79c6821a1dbb97cc5c18ba3a1ca3cdb 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 |
@@ -1195,10 +1195,20 @@ import java.util.Map; |
if (mNativeContentViewCore != 0) nativeClearHistory(mNativeContentViewCore); |
} |
- String getSelectedText() { |
+ /** |
+ * @return The selected text (empty if no text selected). |
+ */ |
+ public String getSelectedText() { |
return mHasSelection ? mLastSelectedText : ""; |
} |
+ /** |
+ * @return Whether the current selection is editable (false if no text selected). |
+ */ |
+ public boolean isSelectionEditable() { |
+ return mHasSelection ? mSelectionEditable : false; |
+ } |
+ |
// End FrameLayout overrides. |
/** |
@@ -1449,6 +1459,10 @@ import java.util.Map; |
} |
} |
+ public boolean isSelectActionBarShowing() { |
+ return mActionMode != null; |
+ } |
+ |
private void resetGestureDetectors() { |
mContentViewGestureHandler.resetGestureHandlers(); |
} |
@@ -2022,10 +2036,16 @@ import java.util.Map; |
return mInsertionHandleController; |
} |
+ @VisibleForTesting |
public InsertionHandleController getInsertionHandleControllerForTest() { |
return mInsertionHandleController; |
} |
+ @VisibleForTesting |
+ public SelectionHandleController getSelectionHandleControllerForTest() { |
+ return mSelectionHandleController; |
+ } |
+ |
private void updateHandleScreenPositions() { |
if (isSelectionHandleShowing()) { |
mSelectionHandleController.setStartHandlePosition( |