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

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

Issue 2114963002: Create Java infrastructure for UI Render Tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/SnippetsSource.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsSource.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsSource.java
new file mode 100644
index 0000000000000000000000000000000000000000..3e5adb83e45e28489fb8636f26d68110a26312c7
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsSource.java
@@ -0,0 +1,52 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.ntp.snippets;
+
+import android.graphics.Bitmap;
+
+import org.chromium.base.Callback;
+
+import java.util.List;
+
+
+/**
+ * An interface for classes that provide Snippets.
+ */
+public interface SnippetsSource {
+ /**
+ * An observer for events in the snippets service.
+ */
+ public interface SnippetsObserver {
+ void onSnippetsReceived(List<SnippetArticle> snippets);
+
+ /** Called when the service is about to change its state. */
+ void onDisabledReasonChanged(int disabledReason);
+ }
+
+ /**
+ * Tells the source to discard the snippet.
+ */
+ public void discardSnippet(SnippetArticle snippet);
+
+ /**
+ * Fetches the thumbnail image for a snippet.
+ */
+ public void fetchSnippetImage(SnippetArticle snippet, Callback<Bitmap> callback);
+
+ /**
+ * Checks whether a snippet has been visited.
+ */
+ public void getSnippedVisited(SnippetArticle snippet, Callback<Boolean> callback);
+
+ /**
+ * Sets the recipient for the fetched snippets.
+ */
+ public void setObserver(SnippetsObserver observer);
+
+ /**
+ * Gives the reason snippets are disabled.
+ */
+ public int getDisabledReason();
+}

Powered by Google App Engine
This is Rietveld 408576698