| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java
|
| index 8c0078ae9007e8e6ce91dd69738dc4b2dede56a6..4e95cbfbf9ee584ca301cc320bdaf5b155ef1f2d 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java
|
| @@ -18,7 +18,7 @@ public abstract class InnerNode extends ChildNode implements NodeParent {
|
|
|
| protected abstract List<TreeNode> getChildren();
|
|
|
| - int getChildIndexForPosition(int position) {
|
| + private int getChildIndexForPosition(int position) {
|
| List<TreeNode> children = getChildren();
|
| int numItems = 0;
|
| int numChildren = children.size();
|
| @@ -42,6 +42,13 @@ public abstract class InnerNode extends ChildNode implements NodeParent {
|
| return getStartingOffsetForChildIndex(getChildren().indexOf(child));
|
| }
|
|
|
| + /**
|
| + * Returns the child whose subtree contains the item at the given position.
|
| + */
|
| + TreeNode getChildForPosition(int position) {
|
| + return getChildren().get(getChildIndexForPosition(position));
|
| + }
|
| +
|
| @Override
|
| public int getItemCount() {
|
| int numItems = 0;
|
| @@ -74,6 +81,13 @@ public abstract class InnerNode extends ChildNode implements NodeParent {
|
| }
|
|
|
| @Override
|
| + public int getDismissSiblingPosDelta(int position) {
|
| + int index = getChildIndexForPosition(position);
|
| + return getChildren().get(index).getDismissSiblingPosDelta(
|
| + position - getStartingOffsetForChildIndex(index));
|
| + }
|
| +
|
| + @Override
|
| public void onItemRangeChanged(TreeNode child, int index, int count) {
|
| notifyItemRangeChanged(getStartingOffsetForChild(child) + index, count);
|
| }
|
|
|