| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java
|
| index 69ccca4556404bf62277b00a7ce2326223eb1f7f..9eb479a2dfb426b164b054eb6c723cf14f62ab7b 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java
|
| @@ -16,6 +16,7 @@
|
| import org.chromium.chrome.browser.ntp.NewTabPageLayout;
|
| import org.chromium.chrome.browser.ntp.NewTabPageUma;
|
| import org.chromium.chrome.browser.ntp.NewTabPageView.NewTabPageManager;
|
| +import org.chromium.chrome.browser.ntp.UiConfig;
|
| import org.chromium.chrome.browser.ntp.snippets.DisabledReason;
|
| import org.chromium.chrome.browser.ntp.snippets.SnippetArticleListItem;
|
| import org.chromium.chrome.browser.ntp.snippets.SnippetArticleViewHolder;
|
| @@ -46,6 +47,7 @@
|
| private final NewTabPageLayout mNewTabPageLayout;
|
| private final AboveTheFoldListItem mAboveTheFoldListItem;
|
| private final SnippetHeaderListItem mHeaderListItem;
|
| + private final UiConfig mUiConfig;
|
| private StatusListItem mStatusListItem;
|
| private final List<NewTabPageListItem> mNewTabPageListItems;
|
| private final ItemTouchCallbacks mItemTouchCallbacks;
|
| @@ -110,9 +112,10 @@ public void onChildDraw(Canvas c, RecyclerView recyclerView, ViewHolder viewHold
|
| * @param newTabPageLayout the layout encapsulating all the above-the-fold elements
|
| * (logo, search box, most visited tiles)
|
| * @param snippetsBridge the bridge to interact with the snippets service.
|
| + * @param uiConfig the NTP UI configuration, to be passed to created views.
|
| */
|
| public NewTabPageAdapter(NewTabPageManager manager, NewTabPageLayout newTabPageLayout,
|
| - SnippetsBridge snippetsBridge) {
|
| + SnippetsBridge snippetsBridge, UiConfig uiConfig) {
|
| mNewTabPageManager = manager;
|
| mNewTabPageLayout = newTabPageLayout;
|
| mAboveTheFoldListItem = new AboveTheFoldListItem();
|
| @@ -121,6 +124,7 @@ public NewTabPageAdapter(NewTabPageManager manager, NewTabPageLayout newTabPageL
|
| mNewTabPageListItems = new ArrayList<NewTabPageListItem>();
|
| mWantsSnippets = true;
|
| mSnippetsBridge = snippetsBridge;
|
| + mUiConfig = uiConfig;
|
| mStatusListItem = StatusListItem.create(snippetsBridge.getDisabledReason(), this, manager);
|
|
|
| loadSnippets(new ArrayList<SnippetArticleListItem>());
|
| @@ -183,12 +187,12 @@ public NewTabPageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
| }
|
|
|
| if (viewType == NewTabPageListItem.VIEW_TYPE_HEADER) {
|
| - return new SnippetHeaderViewHolder(
|
| - SnippetHeaderListItem.createView(parent), mRecyclerView);
|
| + return new SnippetHeaderViewHolder(mRecyclerView, mUiConfig);
|
| }
|
|
|
| if (viewType == NewTabPageListItem.VIEW_TYPE_SNIPPET) {
|
| - return new SnippetArticleViewHolder(mRecyclerView, mNewTabPageManager, mSnippetsBridge);
|
| + return new SnippetArticleViewHolder(
|
| + mRecyclerView, mNewTabPageManager, mSnippetsBridge, mUiConfig);
|
| }
|
|
|
| if (viewType == NewTabPageListItem.VIEW_TYPE_SPACING) {
|
| @@ -196,7 +200,7 @@ public NewTabPageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
| }
|
|
|
| if (viewType == NewTabPageListItem.VIEW_TYPE_STATUS) {
|
| - return new StatusListItem.ViewHolder(mRecyclerView);
|
| + return new StatusListItem.ViewHolder(mRecyclerView, mUiConfig);
|
| }
|
|
|
| return null;
|
|
|