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

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

Issue 2658163003: [Android NTP] Cache number of items under child nodes (Closed)
Patch Set: review Created 3 years, 11 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
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/Leaf.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/Leaf.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/Leaf.java
index 1df0a871d41b1a9155122001a70d141819e42fe0..8ba3e9a05a180483444b1d1cfdaa8e08a3eae344 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/Leaf.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/Leaf.java
@@ -16,8 +16,14 @@ import java.util.Set;
* implementation that will take care of hiding or showing the item.
*/
public abstract class Leaf extends ChildNode {
+ protected Leaf() {
+ // Initialize the item count to 1 (at this point the parent is null, so no notification will
+ // be sent).
+ notifyItemInserted(0);
+ }
+
@Override
- public int getItemCount() {
+ protected final int getItemCountForDebugging() {
return 1;
}

Powered by Google App Engine
This is Rietveld 408576698