| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
|
| index dacb2470aa834186b5c00f579ec6f01fab980344..5639e2d2cfe79e7a13ce8b9133d10cb8674af6d6 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
|
| @@ -257,6 +257,18 @@ public class NewTabPageRecyclerView extends RecyclerView {
|
| }
|
|
|
| /**
|
| + * Returns the approximate adapter position that the user has scrolled to. The purpose of this
|
| + * value is that it can be stored and later retrieved to restore a scroll position that is
|
| + * familiar to the user, showing (part of) the same content the user was previously looking at.
|
| + * This position is valid for that purpose regardless of device orientation changes. Note that
|
| + * if the underlying data has changed in the meantime, different content would be shown for this
|
| + * position.
|
| + */
|
| + public int getScrollPosition() {
|
| + return mLayoutManager.findFirstVisibleItemPosition();
|
| + }
|
| +
|
| + /**
|
| * Finds the view holder for the first header.
|
| * @return The {@code ViewHolder} of the header, or null if it is not present.
|
| */
|
|
|