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

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

Issue 2622793003: 📰 Implement offline badge refresh via partial bind (Closed)
Patch Set: 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 94580276b8c64d4e7022c849ead4aa94a5bac506..bc37e383a048c8ab9ee76e70b6418bb7b9e49d76 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
@@ -48,9 +48,6 @@
/** Stores whether impression of this article has been tracked already. */
private boolean mImpressionTracked;
- /** To be run when the offline status of the article changes. */
- private Runnable mOfflineStatusChangeRunnable;
-
/** Whether the linked article represents an asset download. */
public boolean mIsAssetDownload;
@@ -115,14 +112,6 @@ public boolean trackImpression() {
return true;
}
- /**
- * Sets the {@link Runnable} to be run when the article's offline status changes.
- * Pass null to wipe.
- */
- public void setOfflineStatusChangeRunnable(Runnable runnable) {
- mOfflineStatusChangeRunnable = runnable;
- }
-
/** @return whether a snippet is either offline page or asset download. */
public boolean isDownload() {
return mCategory == KnownCategories.DOWNLOADS;
@@ -202,14 +191,7 @@ public void setRecentTabData(String tabId, long offlinePageId) {
/** Sets offline id of the corresponding to the snippet offline page. Null to clear.*/
public void setOfflinePageOfflineId(@Nullable Long offlineId) {
- Long previous = mOfflinePageOfflineId;
mOfflinePageOfflineId = offlineId;
-
- if (mOfflineStatusChangeRunnable == null) return;
- if ((previous == null) ? (mOfflinePageOfflineId != null)
- : !previous.equals(mOfflinePageOfflineId)) {
- mOfflineStatusChangeRunnable.run();
- }
}
/**

Powered by Google App Engine
This is Rietveld 408576698