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

Unified Diff: components/variations/variations_seed_store.h

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: Newline added due to clang build error Created 5 years, 1 month 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: components/variations/variations_seed_store.h
diff --git a/components/variations/variations_seed_store.h b/components/variations/variations_seed_store.h
index cc743d88cd29fdb5caa17e71b38d414d046fec49..42a6a59c516804d67986f5bda8454fbeffa44ab8 100644
--- a/components/variations/variations_seed_store.h
+++ b/components/variations/variations_seed_store.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/time/time.h"
@@ -20,6 +21,9 @@ class VariationsSeed;
namespace variations {
+typedef base::Callback<void(std::string*, std::string*, std::string*)>
+ VariationsFirstRunSeedCallback;
+
// VariationsSeedStore is a helper class for reading and writing the variations
// seed from Local State.
class VariationsSeedStore {
@@ -75,6 +79,13 @@ class VariationsSeedStore {
// Registers Local State prefs used by this class.
static void RegisterPrefs(PrefRegistrySimple* registry);
+ // Registers callback for pulling variations first run seed from Java side
+ // in Chrome for Android.
+ void SetVariationsFirstRunSeedCallback(
+ const VariationsFirstRunSeedCallback& callback) {
+ get_variations_first_run_seed_ = callback;
+ }
+
protected:
// Note: UMA histogram enum - don't re-order or remove entries.
enum VerifySignatureResult {
@@ -103,6 +114,12 @@ class VariationsSeedStore {
// Clears all prefs related to variations seed storage.
void ClearPrefs();
+#if defined(OS_ANDROID)
+ // Imports the variations seed data from Java side during the first
+ // Chrome for Android run.
+ void ImportFirstRunJavaSeed();
+#endif // OS_ANDROID
+
// Reads the variations seed data from prefs; returns true on success.
bool ReadSeedData(std::string* seed_data);
@@ -134,6 +151,8 @@ class VariationsSeedStore {
// Keeps track of an invalid signature.
std::string invalid_base64_signature_;
+ VariationsFirstRunSeedCallback get_variations_first_run_seed_;
+
DISALLOW_COPY_AND_ASSIGN(VariationsSeedStore);
};
« no previous file with comments | « components/variations/service/variations_service_client.cc ('k') | components/variations/variations_seed_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698