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 a6f50a38e44ab3251eb55128cfe9d5ae6b551e84..aa907eb81b9879e45ab87c015c3ca677f4a2fc57 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 |
@@ -102,6 +102,7 @@ public class SelectionPopupController extends ActionModeCallbackHelper { |
private boolean mEditable; |
private boolean mIsPasswordType; |
private boolean mIsInsertion; |
+ private boolean mCanSelectAllForPastePopup; |
private boolean mUnselectAllOnDismiss; |
private String mLastSelectedText; |
@@ -251,13 +252,14 @@ public class SelectionPopupController extends ActionModeCallbackHelper { |
return actionMode; |
} |
- void createAndShowPastePopup(int x, int y) { |
+ void createAndShowPastePopup(int x, int y, boolean canSelectAll) { |
if (mView.getParent() == null || mView.getVisibility() != View.VISIBLE) { |
return; |
} |
if (!supportsFloatingActionMode() && !canPaste()) return; |
destroyPastePopup(); |
+ mCanSelectAllForPastePopup = canSelectAll; |
PastePopupMenuDelegate delegate = new PastePopupMenuDelegate() { |
@Override |
public void paste() { |
@@ -269,6 +271,16 @@ public class SelectionPopupController extends ActionModeCallbackHelper { |
public boolean canPaste() { |
return SelectionPopupController.this.canPaste(); |
} |
+ |
+ @Override |
+ public void selectAll() { |
+ SelectionPopupController.this.selectAll(); |
+ } |
+ |
+ @Override |
+ public boolean canSelectAll() { |
+ return SelectionPopupController.this.canSelectAll(); |
+ } |
}; |
Context windowContext = mWindowAndroid.getContext().get(); |
if (windowContext == null) return; |
@@ -741,6 +753,14 @@ public class SelectionPopupController extends ActionModeCallbackHelper { |
} |
/** |
+ * @return true if the current selection can select all. |
+ */ |
+ @VisibleForTesting |
+ public boolean canSelectAll() { |
+ return mCanSelectAllForPastePopup; |
+ } |
+ |
+ /** |
* @return true if the current selection is for incognito content. |
* Note: This should remain constant for the callback's lifetime. |
*/ |