| 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 2426ef7972aeec02e7ee04d14f418120ec759ac2..1a1ac8f7eaa0fb43a6475b2fd6aceb524250879a 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
|
| @@ -301,9 +301,10 @@ public class NewTabPageView extends FrameLayout
|
| * @param manager NewTabPageManager used to perform various actions when the user interacts
|
| * with the page.
|
| * @param searchProviderHasLogo Whether the search provider has a logo.
|
| - * @param snippetsBridge The optional bridge, that can be used to interact with the snippets.
|
| + * @param scrollPosition The adapter scroll position to initialize to.
|
| */
|
| - public void initialize(NewTabPageManager manager, boolean searchProviderHasLogo) {
|
| + public void initialize(
|
| + NewTabPageManager manager, boolean searchProviderHasLogo, int scrollPosition) {
|
| mManager = manager;
|
| mUiConfig = new UiConfig(this);
|
| ViewStub stub = (ViewStub) findViewById(R.id.new_tab_page_layout_stub);
|
| @@ -359,6 +360,7 @@ public class NewTabPageView extends FrameLayout
|
| mNewTabPageAdapter =
|
| new NewTabPageAdapter(mManager, mNewTabPageLayout, mUiConfig);
|
| mRecyclerView.setAdapter(mNewTabPageAdapter);
|
| + mRecyclerView.scrollToPosition(scrollPosition);
|
|
|
| // Set up swipe-to-dismiss
|
| ItemTouchHelper helper =
|
| @@ -1185,4 +1187,11 @@ public class NewTabPageView extends FrameLayout
|
| return mScrollView.getScrollY();
|
| }
|
| }
|
| +
|
| + /**
|
| + * @return The adapter position the user has scrolled to.
|
| + */
|
| + public int getScrollPosition() {
|
| + return mRecyclerView.getScrollPosition();
|
| + }
|
| }
|
|
|