Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java

Issue 2434263002: 📰 Refresh the visiblity of AllDismissed when items change (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4e95cbfbf9ee584ca301cc320bdaf5b155ef1f2d..476980470ac5a0e0f50ccdb2d344406a4a3cfc2c 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
@@ -31,6 +31,10 @@ private int getChildIndexForPosition(int position) {
private int getStartingOffsetForChildIndex(int childIndex) {
List<TreeNode> children = getChildren();
+ if (childIndex < 0 || childIndex >= children.size()) {
+ throw new IndexOutOfBoundsException(childIndex + "/" + children.size());
+ }
+
int offset = 0;
for (int i = 0; i < childIndex; i++) {
offset += children.get(i).getItemCount();
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698