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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java

Issue 2618893003: 📰 Tweak the suggestion ranks for UMA to handle fetchMore (Closed)
Patch Set: rebase, address comments 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/snippets/SnippetArticle.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
index bc37e383a048c8ab9ee76e70b6418bb7b9e49d76..95f20e506c45ccf4ba098e1ba6c5db12385446d8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
@@ -36,11 +36,11 @@
/** The score expressing relative quality of the article for the user. */
public final float mScore;
- /** The position of this article within its section. */
- public final int mPosition;
+ /** The rank of this article within its section. */
+ private int mPerSectionRank = -1;
- /** The position of this article in the complete list. Populated by NewTabPageAdapter. */
- public int mGlobalPosition = -1;
+ /** The global rank of this article in the complete list. */
+ private int mGlobalRank = -1;
/** Bitmap of the thumbnail, fetched lazily, when the RecyclerView wants to show the snippet. */
private Bitmap mThumbnailBitmap;
@@ -67,7 +67,7 @@
* Creates a SnippetArticleListItem object that will hold the data.
*/
public SnippetArticle(int category, String idWithinCategory, String title, String publisher,
- String previewText, String url, long timestamp, float score, int position) {
+ String previewText, String url, long timestamp, float score) {
mCategory = category;
mIdWithinCategory = idWithinCategory;
mTitle = title;
@@ -76,7 +76,6 @@ public SnippetArticle(int category, String idWithinCategory, String title, Strin
mUrl = url;
mPublishTimestampMilliseconds = timestamp;
mScore = score;
- mPosition = position;
}
@Override
@@ -208,4 +207,17 @@ public String toString() {
// For debugging purposes. Displays the first 42 characters of the title.
return String.format("{%s, %1.42s}", getClass().getSimpleName(), mTitle);
}
+
+ public void setRank(int perSectionRank, int globalRank) {
+ mPerSectionRank = perSectionRank;
+ mGlobalRank = globalRank;
+ }
+
+ public int getGlobalRank() {
+ return mGlobalRank;
+ }
+
+ public int getPerSectionRank() {
+ return mPerSectionRank;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698