Index: components/variations/variations_seed_store.cc |
diff --git a/components/variations/variations_seed_store.cc b/components/variations/variations_seed_store.cc |
index 84dca7e3ce91341fab819cdd6a711b0d122de543..91fc4e65f2997a553844e21fba5f83c6e9eb094e 100644 |
--- a/components/variations/variations_seed_store.cc |
+++ b/components/variations/variations_seed_store.cc |
@@ -17,6 +17,10 @@ |
#include "crypto/signature_verifier.h" |
#include "third_party/protobuf/src/google/protobuf/io/coded_stream.h" |
+#if defined(OS_ANDROID) |
+#include "components/variations/android/variations_seed_bridge.h" |
+#endif // OS_ANDROID |
+ |
namespace variations { |
namespace { |
@@ -384,7 +388,6 @@ void VariationsSeedStore::ImportFirstRunJavaSeed() { |
LOG(WARNING) << "First run variations seed is invalid."; |
return; |
} |
- // TODO(agulenko): Clear Java prefs. |
RecordFirstRunResult(FIRST_RUN_SEED_IMPORT_SUCCESS); |
} |
#endif // OS_ANDROID |
@@ -464,6 +467,16 @@ bool VariationsSeedStore::StoreSeedDataNoDelta( |
// in M45+. |
local_state_->ClearPref(prefs::kVariationsSeed); |
+#if defined(OS_ANDROID) |
+ // If currently we do not have any stored pref then we mark seed storing as |
+ // successful on the Java side of Chrome for Android to avoid repeated seed |
+ // fetches and clear preferences on the Java side. |
+ if (local_state_->GetString(prefs::kVariationsCompressedSeed).empty()) { |
+ android::MarkVariationsSeedAsStored(); |
+ android::ClearJavaFirstRunPrefs(); |
+ } |
+#endif |
+ |
// Update the saved country code only if one was returned from the server. |
// Prefer the country code that was transmitted in the header over the one in |
// the seed (which is deprecated). |