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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuParams.java

Issue 1142863002: Remove support for custom menu items in context menus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuParams.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuParams.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuParams.java
index 71d168f49867db22c1164d08d81cbf876300f131..96a2b4752b95fafd08070dbab450dcd64c1ca3cd 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuParams.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuParams.java
@@ -10,8 +10,6 @@ import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
import org.chromium.content_public.common.Referrer;
-import java.util.ArrayList;
-
/**
* A list of parameters that explain what kind of context menu to show the user. This data is
* generated from content/public/common/context_menu_params.h.
@@ -29,16 +27,6 @@ public class ContextMenuParams {
public static final int MEDIA_TYPE_PLUGIN = 5;
}
- private static class CustomMenuItem {
- public final String label;
- public final int action;
-
- public CustomMenuItem(String label, int action) {
- this.label = label;
- this.action = action;
- }
- }
-
private final String mPageUrl;
private final String mLinkUrl;
private final String mLinkText;
@@ -54,42 +42,6 @@ public class ContextMenuParams {
private final boolean mIsImage;
private final boolean mIsVideo;
- private final ArrayList<CustomMenuItem> mCustomMenuItems = new ArrayList<CustomMenuItem>();
-
- /**
- * @return Whether or not the context menu should consist of custom items.
- */
- public boolean isCustomMenu() {
- return !mCustomMenuItems.isEmpty();
- }
-
- /**
- * @return The number of custom items in this context menu.
- */
- public int getCustomMenuSize() {
- return mCustomMenuItems.size();
- }
-
- /**
- * The label that should be shown for the custom menu item at {@code index}.
- * @param index The index of the custom menu item.
- * @return The label to show.
- */
- public String getCustomLabelAt(int index) {
- assert index >= 0 && index < mCustomMenuItems.size();
- return mCustomMenuItems.get(index).label;
- }
-
- /**
- * The action that should be returned for the custom menu item at {@code index}.
- * @param index The index of the custom menu item.
- * @return The action to return.
- */
- public int getCustomActionAt(int index) {
- assert index >= 0 && index < mCustomMenuItems.size();
- return mCustomMenuItems.get(index).action;
- }
-
/**
* @return The URL associated with the main frame of the page that triggered the context menu.
*/
@@ -210,9 +162,4 @@ public class ContextMenuParams {
return new ContextMenuParams(mediaType, pageUrl, linkUrl, linkText, unfilteredLinkUrl,
srcUrl, selectionText, titleText, imageWasFetchedLoFi, isEditable, referrer);
}
-
- @CalledByNative
- private void addCustomItem(String label, int action) {
- mCustomMenuItems.add(new CustomMenuItem(label, action));
- }
}

Powered by Google App Engine
This is Rietveld 408576698