| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
|
| index 707514e1c0ff2dd9f2d33fc50b0a2a7bc79db289..a43fae171c508e8c986110431a40fb5d134ad923 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
|
| @@ -44,12 +44,12 @@
|
| import org.chromium.chrome.browser.ntp.LogoBridge.LogoObserver;
|
| import org.chromium.chrome.browser.ntp.MostVisitedItem.MostVisitedItemManager;
|
| import org.chromium.chrome.browser.ntp.NewTabPage.OnSearchBoxScrollListener;
|
| +import org.chromium.chrome.browser.ntp.cards.CardItemDecoration;
|
| import org.chromium.chrome.browser.ntp.cards.CardsLayoutOperations;
|
| import org.chromium.chrome.browser.ntp.cards.NewTabPageAdapter;
|
| import org.chromium.chrome.browser.ntp.cards.NewTabPageListItem;
|
| import org.chromium.chrome.browser.ntp.cards.NewTabPageRecyclerView;
|
| import org.chromium.chrome.browser.ntp.snippets.SnippetArticle;
|
| -import org.chromium.chrome.browser.ntp.snippets.SnippetItemDecoration;
|
| import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge.SnippetsObserver;
|
| import org.chromium.chrome.browser.profiles.MostVisitedSites.MostVisitedURLsObserver;
|
| import org.chromium.chrome.browser.profiles.MostVisitedSites.ThumbnailCallback;
|
| @@ -241,6 +241,11 @@ void ensureIconIsAvailable(String pageUrl, String iconUrl, boolean isLargeIcon,
|
| * @param callback Callback to run after fetching completes (successful or not).
|
| */
|
| void fetchSnippetImage(SnippetArticle snippet, Callback<Bitmap> callback);
|
| +
|
| + /**
|
| + * Requests new snippets.
|
| + */
|
| + void fetchSnippets();
|
| }
|
|
|
| /**
|
| @@ -290,6 +295,7 @@ public void initialize(NewTabPageManager manager,
|
| (NewTabPageLayout) LayoutInflater.from(getContext())
|
| .inflate(R.layout.new_tab_page_layout, mRecyclerView, false);
|
| mNewTabPageLayout.setUseCardsUiEnabled(mUseCardsUi);
|
| + mRecyclerView.setAboveTheFoldView(mNewTabPageLayout);
|
|
|
| // Tailor the LayoutParams for the snippets UI, as the configuration in the XML is
|
| // made for the ScrollView UI.
|
| @@ -415,7 +421,7 @@ public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
| }
|
| });
|
| initializeSearchBoxRecyclerViewScrollHandling();
|
| - mRecyclerView.addItemDecoration(new SnippetItemDecoration());
|
| + mRecyclerView.addItemDecoration(new CardItemDecoration(getContext()));
|
| CardsLayoutOperations.updateSnippetsHeaderDisplay(mRecyclerView,
|
| mNewTabPageLayout.getPaddingTop());
|
| } else {
|
| @@ -495,8 +501,7 @@ public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
| mRecyclerView.postDelayed(mSnapScrollRunnable, SNAP_SCROLL_DELAY_MS);
|
| }
|
| updateSearchBoxOnScroll();
|
| - CardsLayoutOperations
|
| - .updatePeekingCard(mRecyclerView, mNewTabPageLayout, getHeight());
|
| + CardsLayoutOperations.updatePeekingCard(mRecyclerView, getHeight());
|
| CardsLayoutOperations.updateSnippetsHeaderDisplay(mRecyclerView,
|
| mNewTabPageLayout.getPaddingTop());
|
| }
|
| @@ -836,7 +841,7 @@ public void onLayoutChange(View v, int left, int top, int right, int bottom,
|
| updateSearchBoxOnScroll();
|
|
|
| if (mUseCardsUi) {
|
| - CardsLayoutOperations.updatePeekingCard(mRecyclerView, mNewTabPageLayout, getHeight());
|
| + CardsLayoutOperations.updatePeekingCard(mRecyclerView, getHeight());
|
| }
|
| }
|
|
|
| @@ -1100,7 +1105,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
| super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
|
|
| if (mUseCardsUi) {
|
| - CardsLayoutOperations.updatePeekingCard(mRecyclerView, mNewTabPageLayout, getHeight());
|
| + CardsLayoutOperations.updatePeekingCard(mRecyclerView, getHeight());
|
| }
|
| }
|
|
|
|
|