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

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

Issue 2954023002: Fixing SelectionPopupController.isInsertion() race condition (Closed)
Patch Set: Renaming isInsertion to isInsertionForTesting Created 3 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
« no previous file with comments | « no previous file | content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java » ('j') | 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/SelectionPopupController.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java b/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java
index 54006b0fd157902254270ca3462b65c7b583fd06..9d5b71a68174f7ce1b9d20f46f7cb37adc962b70 100644
--- a/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java
+++ b/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java
@@ -111,7 +111,7 @@ public class SelectionPopupController extends ActionModeCallbackHelper {
private boolean mEditable;
private boolean mIsPasswordType;
- private boolean mIsInsertion;
+ private boolean mIsInsertionForTesting;
private boolean mCanSelectAllForPastePopup;
private boolean mCanEditRichly;
@@ -502,7 +502,7 @@ public class SelectionPopupController extends ActionModeCallbackHelper {
"paste_as_plain_text", "string", "android"));
}
- if (isInsertion() || isSelectionPassword()) return;
+ if (!hasSelection() || isSelectionPassword()) return;
initializeTextProcessingMenu(menu);
}
@@ -888,8 +888,8 @@ public class SelectionPopupController extends ActionModeCallbackHelper {
* @return true if the current selection is an insertion point.
*/
@VisibleForTesting
- public boolean isInsertion() {
- return mIsInsertion;
+ public boolean isInsertionForTesting() {
+ return mIsInsertionForTesting;
}
/**
@@ -991,7 +991,7 @@ public class SelectionPopupController extends ActionModeCallbackHelper {
case SelectionEventType.INSERTION_HANDLE_SHOWN:
mSelectionRect.set(left, top, right, bottom);
- mIsInsertion = true;
+ mIsInsertionForTesting = true;
break;
case SelectionEventType.INSERTION_HANDLE_MOVED:
@@ -1015,7 +1015,7 @@ public class SelectionPopupController extends ActionModeCallbackHelper {
case SelectionEventType.INSERTION_HANDLE_CLEARED:
destroyPastePopup();
- mIsInsertion = false;
+ mIsInsertionForTesting = false;
mSelectionRect.setEmpty();
break;
« no previous file with comments | « no previous file | content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698