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

Unified Diff: chrome/browser/metrics/variations/variations_service.cc

Issue 1293113004: Introduce (Chrome)VariationsServiceClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self-review Created 5 years, 4 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/browser/metrics/variations/variations_service.cc
diff --git a/chrome/browser/metrics/variations/variations_service.cc b/chrome/browser/metrics/variations/variations_service.cc
index 112eae58c614a6ddb9b3df322bf021fa1b711cb1..4ab913422fa7e1d5d5f9196443292fae01bb377c 100644
--- a/chrome/browser/metrics/variations/variations_service.cc
+++ b/chrome/browser/metrics/variations/variations_service.cc
@@ -243,10 +243,12 @@ void OverrideUIString(uint32_t hash, const base::string16& string) {
} // namespace
VariationsService::VariationsService(
+ scoped_ptr<VariationsServiceClient> client,
web_resource::ResourceRequestAllowedNotifier* notifier,
PrefService* local_state,
metrics::MetricsStateManager* state_manager)
- : local_state_(local_state),
+ : client_(client.Pass()),
+ local_state_(local_state),
state_manager_(state_manager),
policy_pref_service_(local_state),
seed_store_(local_state),
@@ -281,7 +283,7 @@ bool VariationsService::CreateTrialsFromSeed() {
const std::string latest_country =
local_state_->GetString(prefs::kVariationsCountry);
variations::VariationsSeedProcessor().CreateTrialsFromSeed(
- seed, g_browser_process->GetApplicationLocale(),
+ seed, client_->GetApplicationLocale(),
GetReferenceDateForExpiryChecks(local_state_), current_version, channel,
GetCurrentFormFactor(), GetHardwareClass(), latest_country,
LoadPermanentConsistencyCountry(current_version, latest_country),
@@ -448,6 +450,7 @@ void VariationsService::RegisterProfilePrefs(
// static
scoped_ptr<VariationsService> VariationsService::Create(
+ scoped_ptr<VariationsServiceClient> client,
PrefService* local_state,
metrics::MetricsStateManager* state_manager) {
scoped_ptr<VariationsService> result;
@@ -462,8 +465,8 @@ scoped_ptr<VariationsService> VariationsService::Create(
}
#endif
result.reset(new VariationsService(
- new web_resource::ResourceRequestAllowedNotifier(
- local_state, switches::kDisableBackgroundNetworking),
+ client.Pass(), new web_resource::ResourceRequestAllowedNotifier(
+ local_state, switches::kDisableBackgroundNetworking),
local_state, state_manager));
return result.Pass();
}
@@ -678,7 +681,7 @@ void VariationsService::PerformSimulationWithVersion(
local_state_->GetString(prefs::kVariationsCountry);
const variations::VariationsSeedSimulator::Result result =
seed_simulator.SimulateSeedStudies(
- *seed, g_browser_process->GetApplicationLocale(),
+ *seed, client_->GetApplicationLocale(),
GetReferenceDateForExpiryChecks(local_state_), version,
GetChannelForVariations(), GetCurrentFormFactor(), GetHardwareClass(),
latest_country,

Powered by Google App Engine
This is Rietveld 408576698