| 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();
|
| +}
|
|
|