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

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

Issue 2623993007: 🏠 Extract the ContentSuggestionManager interface from NTP (Closed)
Patch Set: aaaand rebase again 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
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardViewHolder.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardViewHolder.java
index 41b37ca39cfd280c08ae4c765b96b7d54488ce04..05a102fe16ae14529b25f788ebd1a2575caf5364 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardViewHolder.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardViewHolder.java
@@ -20,7 +20,6 @@
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ntp.ContextMenuManager;
-import org.chromium.chrome.browser.ntp.NewTabPageView.NewTabPageManager;
import org.chromium.chrome.browser.ntp.UiConfig;
import org.chromium.chrome.browser.util.MathUtils;
import org.chromium.chrome.browser.util.ViewUtils;
@@ -59,7 +58,6 @@
private final UiConfig mUiConfig;
private final MarginResizer mMarginResizer;
- private final NewTabPageManager mNtpManager;
/**
* To what extent the card is "peeking". 0 means the card is not peeking at all and spans the
@@ -74,9 +72,10 @@
* @param layoutId resource id of the layout to inflate and to use as card.
* @param recyclerView ViewGroup that will contain the newly created view.
* @param uiConfig The NTP UI configuration object used to adjust the card UI.
+ * @param contextMenuManager The manager responsible for the context menu.
*/
public CardViewHolder(int layoutId, final NewTabPageRecyclerView recyclerView,
- UiConfig uiConfig, NewTabPageManager ntpManager) {
+ UiConfig uiConfig, final ContextMenuManager contextMenuManager) {
super(inflateView(layoutId, recyclerView));
mCards9PatchAdjustment = recyclerView.getResources().getDimensionPixelSize(
@@ -106,7 +105,7 @@ public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo men
ContextMenuManager.Delegate delegate = getContextMenuDelegate();
if (delegate == null) return;
- mNtpManager.getContextMenuManager().createContextMenu(menu, itemView, delegate);
+ contextMenuManager.createContextMenu(menu, itemView, delegate);
}
});
@@ -117,8 +116,6 @@ public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo men
// Configure the resizer to use negative margins on regular display to balance out the
// lateral shadow of the card 9-patch and avoid a rounded corner effect.
mMarginResizer.setMargins(-mCards9PatchAdjustment);
-
- mNtpManager = ntpManager;
}
/**

Powered by Google App Engine
This is Rietveld 408576698