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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/ContextMenuManager.java

Issue 2613863007: Track context menu creation for suggestions. (Closed)
Patch Set: format Created 3 years, 11 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 | chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedItem.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/ContextMenuManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/ContextMenuManager.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/ContextMenuManager.java
index 8a290a96734fb3906a81f876440ee482fa62f0f8..fa83ec031a42684fb8733393dde429f2980162f7 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/ContextMenuManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/ContextMenuManager.java
@@ -55,11 +55,17 @@ public class ContextMenuManager implements OnCloseContextMenuListener {
/** Remove the current item. */
void removeItem();
- /** @return whether the current item can be saved offline. */
+ /**
+ * @return the URL of the current item for saving offline, or null if the item can't be
+ * saved offline.
+ */
String getUrl();
/** @return whether the given menu item is supported. */
boolean isItemSupported(@ContextMenuItemId int menuItemId);
+
+ /** Called when a context menu has been created. */
+ void onContextMenuCreated();
}
/** Interface for a view that can be set to stop responding to touches. */
@@ -74,10 +80,11 @@ public class ContextMenuManager implements OnCloseContextMenuListener {
/**
* Populates the context menu.
+ *
* @param menu The menu to populate.
* @param associatedView The view that requested a context menu.
* @param delegate Delegate that defines the configuration of the menu and what to do when items
- * are tapped.
+ * are tapped.
*/
public void createContextMenu(ContextMenu menu, View associatedView, Delegate delegate) {
OnMenuItemClickListener listener = new ItemClickListener(delegate);
@@ -95,6 +102,8 @@ public class ContextMenuManager implements OnCloseContextMenuListener {
// No item added. We won't show the menu, so we can skip the rest.
if (!hasItems) return;
+ delegate.onContextMenuCreated();
+
associatedView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View view) {}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedItem.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698