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

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

Issue 1897313002: Revert of [NTP Snippets] Refresh the displayed snippets less frequently (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/SnippetsBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
index 44c6f0b27b66abb3bb2d6765aeb29dbd358d9446..bcf3b5ee27ba8f398e55ea6d01fc2e48026b875b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
@@ -65,19 +65,18 @@
}
/**
- * Sets the recipient for the fetched snippets.
+ * Sets the recipient for the fetched snippets. This method should be called only once.
*
- * An observer needs to be set before the native code attempts to transmit snippets them to
- * java. Upon registration, the observer will be notified of already fetched snippets.
+ * Before the observer is set, the native code will not attempt to transmit them to java. Upon
+ * registration, the observer will be notified of already fetched snippets.
*
- * @param observer object to notify when snippets are received, or {@code null} if we want to
- * stop observing.
+ * @param observer object to notify when snippets are received.
*/
public void setObserver(SnippetsObserver observer) {
- assert mObserver == null || mObserver == observer;
+ assert mObserver == null;
mObserver = observer;
- nativeSetObserver(mNativeSnippetsBridge, observer == null ? null : this);
+ nativeSetObserver(mNativeSnippetsBridge, this);
}
@CalledByNative

Powered by Google App Engine
This is Rietveld 408576698