Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsConfig.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsConfig.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsConfig.java |
index 4397a92ca3a3fba67080d6fa70e44cb9d4152356..9db06a8ac338841b3bc876a4fa5108386fb5eee6 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsConfig.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsConfig.java |
@@ -4,13 +4,36 @@ |
package org.chromium.chrome.browser.ntp.snippets; |
+import android.support.annotation.IntDef; |
+ |
import org.chromium.chrome.browser.ChromeFeatureList; |
import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
+import java.lang.annotation.Retention; |
+import java.lang.annotation.RetentionPolicy; |
+ |
/** |
* Provides configuration details for NTP snippets. |
*/ |
public final class SnippetsConfig { |
+ /** |
+ * Possible return values from {@code NTPSnippetsBridge::GetDisabledReason} |
+ * @see SnippetsBridge#getDisabledReason() |
+ */ |
+ @IntDef({DISABLED_REASON_NONE, DISABLED_REASON_EXPLICITLY_DISABLED, |
Bernhard Bauer
2016/06/14 12:10:40
Ideally, we'd generate these from the C++ values.
dgn
2016/06/15 16:46:29
Done.
|
+ DISABLED_REASON_HISTORY_SYNC_DISABLED, DISABLED_REASON_HISTORY_SYNC_STATE_UNKNOWN}) |
+ @Retention(RetentionPolicy.SOURCE) |
+ public @interface DisabledReason {} |
+ |
+ /** Snippets are enabled. */ |
+ public static final int DISABLED_REASON_NONE = 0; |
+ /** Snippets have been disabled as part of the service configuration. */ |
+ public static final int DISABLED_REASON_EXPLICITLY_DISABLED = 1; |
+ /** History sync is not enabled, and the service requires it to be enabled. */ |
+ public static final int DISABLED_REASON_HISTORY_SYNC_DISABLED = 2; |
+ /** The sync service is not completely initialized, and the status is unknown. */ |
+ public static final int DISABLED_REASON_HISTORY_SYNC_STATE_UNKNOWN = 3; |
+ |
private SnippetsConfig() {} |
public static boolean isEnabled() { |