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

Unified Diff: components/variations/variations_seed_store.cc

Issue 1437833004: Implemented clearing Java prefs after pulling variations first run seed from Java to C++ side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor code review fixes 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.cc
diff --git a/components/variations/variations_seed_store.cc b/components/variations/variations_seed_store.cc
index 84dca7e3ce91341fab819cdd6a711b0d122de543..173579d26c76c0e8d1f7351d9424dadb951eb762 100644
--- a/components/variations/variations_seed_store.cc
+++ b/components/variations/variations_seed_store.cc
@@ -12,6 +12,7 @@
#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "components/compression/compression_utils.h"
+#include "components/variations/android/variations_seed_bridge.h"
Alexei Svitkine (slow) 2015/11/12 22:27:31 Put the header in an ifdef below since it won't bu
Alexander Agulenko 2015/11/12 23:43:39 Done.
#include "components/variations/pref_names.h"
#include "components/variations/proto/variations_seed.pb.h"
#include "crypto/signature_verifier.h"
@@ -464,6 +465,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).

Powered by Google App Engine
This is Rietveld 408576698