| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsController.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsController.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsController.java
|
| index 28975a63650ae7157011cf3556e4b99fcb8e27a1..64b33f042072b08056f60aec4f154cf721ef26bb 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsController.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsController.java
|
| @@ -4,28 +4,19 @@
|
|
|
| package org.chromium.chrome.browser.ntp.snippets;
|
|
|
| -import android.content.Context;
|
| -
|
| import org.chromium.base.ThreadUtils;
|
| import org.chromium.base.VisibleForTesting;
|
| import org.chromium.chrome.browser.profiles.Profile;
|
| -import org.chromium.chrome.browser.signin.SigninManager;
|
| -import org.chromium.chrome.browser.signin.SigninManager.SignInStateObserver;
|
|
|
| /**
|
| * The main controller for calling into the native snippets component to fetch snippets.
|
| */
|
| -public class SnippetsController implements SignInStateObserver {
|
| +public class SnippetsController {
|
| private static SnippetsController sInstance;
|
|
|
| private long mNativeSnippetsController;
|
|
|
| - public SnippetsController(Context applicationContext) {
|
| - // |applicationContext| can be null in tests.
|
| - if (applicationContext != null) {
|
| - SigninManager.get(applicationContext).addSignInStateObserver(this);
|
| - }
|
| - }
|
| + public SnippetsController() {}
|
|
|
| /**
|
| * Fetches new snippets.
|
| @@ -37,25 +28,16 @@ public class SnippetsController implements SignInStateObserver {
|
| /**
|
| * Retrieve the singleton instance of this class.
|
| *
|
| - * @param context the current context.
|
| * @return the singleton instance.
|
| */
|
| - public static SnippetsController get(Context context) {
|
| + public static SnippetsController get() {
|
| ThreadUtils.assertOnUiThread();
|
| if (sInstance == null) {
|
| - sInstance = new SnippetsController(context.getApplicationContext());
|
| + sInstance = new SnippetsController();
|
| }
|
| return sInstance;
|
| }
|
|
|
| - @Override
|
| - public void onSignedIn() {
|
| - fetchSnippets();
|
| - }
|
| -
|
| - @Override
|
| - public void onSignedOut() {}
|
| -
|
| @VisibleForTesting
|
| public static void setInstanceForTesting(SnippetsController instance) {
|
| sInstance = instance;
|
|
|