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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java

Issue 1417503010: Variations seed is pulled from the Java application on the first launch of Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fix: removed debug output Created 5 years, 2 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/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();
}

Powered by Google App Engine
This is Rietveld 408576698