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

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

Issue 21044008: [Android] Add selection handle tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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/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(

Powered by Google App Engine
This is Rietveld 408576698