Files
brave-core/patches/chrome-android-java-src-org-chromium-chrome-browser-contextmenu-ChromeContextMenuPopulator.java.patch
T
cdesouza-chromium 764f28a940 [plaster][android] Migrate AUTOPLAY patches (#36290)
[cr150][plaster][android] Migrate `AUTOPLAY` patches

This PR migrates several java patches for `AUTOPLAY` to plaster. It uses
the same previous techniques, where we match the enum block and add at
the end.

The only innovation in this PR as an approach for plaster is the
replacement of the value `NUM_ENTRIES` with `+1` for whatever keys we
are inserting, while at the same time using the previous value of
`NUM_ENTRIES` as the starting value for the first key.

Resolved https://github.com/brave/brave-browser/issues/55385
2026-05-19 22:44:45 +01:00

31 lines
1.8 KiB
Diff

diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
index 5b16f302936cb92ebed8a0e0d4c7dc5bf05ceab1..295c8ada54fdad817f69036a0d7f49336620f5ce 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
@@ -245,6 +245,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
Action.EXIT_PICTURE_IN_PICTURE,
Action.OPEN_IN_INCOGNITO_WINDOW,
Action.VIEW_PAGE_SOURCE,
+ Action.COPY_CLEAN_LINK,
})
@Retention(RetentionPolicy.SOURCE)
public @interface Action {
@@ -301,7 +302,8 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
int EXIT_PICTURE_IN_PICTURE = 50;
int OPEN_IN_INCOGNITO_WINDOW = 51;
int VIEW_PAGE_SOURCE = 52;
- int NUM_ENTRIES = 53;
+ int COPY_CLEAN_LINK = 53;
+ int NUM_ENTRIES = COPY_CLEAN_LINK + 1;
}
// LINT.ThenChange(/tools/metrics/histograms/enums.xml:ContextMenuOptionAndroid)
@@ -539,6 +541,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
if (!MailTo.isMailTo(mParams.getLinkUrl().getSpec())
&& !UrlUtilities.isTelScheme(mParams.getLinkUrl())) {
linkGroup.add(createListItem(Item.COPY_LINK_ADDRESS));
+ linkGroup.add(createListItem(Item.COPY_CLEAN_LINK));
if (!mParams.getLinkText().trim().isEmpty() && !mParams.isImage()) {
linkGroup.add(createListItem(Item.COPY_LINK_TEXT));
}