Commit 5a859e11 authored by Bruno Kim Medeiros Cesar's avatar Bruno Kim Medeiros Cesar Committed by Commit Bot

Use permanent stored country preferentially for SafeSearch API.

Bug: 857533
Change-Id: I9a62b52edad78b30cc25dc15f7f098ce3a82bc46
Reviewed-on: https://chromium-review.googlesource.com/1140374
Commit-Queue: Bruno Kim Medeiros Cesar <brunokim@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575691}
parent dc764bb8
......@@ -556,11 +556,16 @@ void SupervisedUserURLFilter::InitAsyncURLChecker(
policy_exception_justification: "Not implemented."
})");
// Prefer using the permanent stored country, which may be unavailable during
// the first run. In that case, try to use the latest country instead.
std::string country;
variations::VariationsService* variations_service =
g_browser_process->variations_service();
if (variations_service)
country = variations_service->GetLatestCountry();
if (variations_service) {
country = variations_service->GetStoredPermanentCountry();
if (country.empty())
country = variations_service->GetLatestCountry();
}
async_url_checker_ = std::make_unique<safe_search_api::URLChecker>(
std::move(url_loader_factory), traffic_annotation, country);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment