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

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

Issue 2747453002: Split context menu display and population/handling (Closed)
Patch Set: I'm genuinely confused on why some code did not upload Created 3 years, 9 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/ContextMenuUi.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuUi.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuUi.java
new file mode 100644
index 0000000000000000000000000000000000000000..59821973cc6be63a55ab2d10d98b9448ea15456e
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuUi.java
@@ -0,0 +1,32 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.contextmenu;
+
+import android.app.Activity;
+import android.util.Pair;
+
+import org.chromium.base.Callback;
+
+import java.util.List;
+
+/**
+ * A representation of the ContextMenu UI. Given a list of items it should populate and display a
+ * context menu.
+ */
+public interface ContextMenuUi {
+ /**
+ * Shows the Context Menu in Chrome.
+ * @param activity Used to inflate the context menu.
+ * @param params The current parameters for the the context menu.
+ * @param items The list of items that need to be displayed in the context menu items. This is
+ * taken from the return value of {@link ContextMenuPopulator#buildContextMenu(
+ * ContextMenu, Context, ContextMenuParams)}.
+ * @param onItemClicked When the user has pressed an item the menuId associated with the item
+ * is sent back through {@link Callback#onResult(Object)}. The ids that
+ * could be called are in ids.xml.
+ */
+ void displayMenu(Activity activity, ContextMenuParams params,
+ List<Pair<Integer, List<ContextMenuItem>>> items, Callback<Integer> onItemClicked);
+}

Powered by Google App Engine
This is Rietveld 408576698