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

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

Issue 2061803002: 📰 The Status card reports disabled sync states (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplifyBridge
Patch Set: [NTP Snippets] The Status card reports disabled sync states 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/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() {

Powered by Google App Engine
This is Rietveld 408576698