Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
| index c5c1564f934cc2c01e0cd420b0881b04861c3966..5209078c6cf73671297f00c41f2d51f5fb30b95a 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
| @@ -219,6 +219,34 @@ public final class PrefServiceBridge { |
| } |
| } |
| + // These constants must coincide with variations prefs name in Chromium core |
| + // prefs::kVariationsSeedSignature and prefs::kVariationsCountry respectively |
|
Alexei Svitkine (slow)
2015/10/28 15:16:38
Can we avoid the C++ code needing to know these in
Alexander Agulenko
2015/10/28 23:05:09
Done.
|
| + public static final String VARIATIONS_FIRST_RUN_SEED_SIGNATURE = "variations_seed_signature"; |
| + public static final String VARIATIONS_FIRST_RUN_COUNTRY = "variations_country"; |
| + |
| + @CalledByNative |
| + public static String getVariationsSeedPref(Context context, String prefName) { |
| + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
| + return prefs.getString(prefName, new String()); |
| + } |
| + |
| + public static void setVariationsSeedPref(Context context, String prefName, String data) { |
| + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
| + prefs.edit().remove(prefName).apply(); |
| + prefs.edit().putString(prefName, data).apply(); |
| + } |
| + |
| + private static byte[] sRawVariationsSeed; |
| + |
| + @CalledByNative |
| + public static byte[] getRawVariationsSeed(Context context) { |
| + return sRawVariationsSeed; |
| + } |
| + |
| + public static void setRawVariationsSeed(Context context, byte[] rawSeed) { |
| + sRawVariationsSeed = rawSeed; |
| + } |
| + |
| public boolean isAcceptCookiesEnabled() { |
| return nativeGetAcceptCookiesEnabled(); |
| } |