blob: f504d13b28117698d92c2c7d7d097e6146fc219f [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "android_webview/browser/aw_variations_service_client.h"
#include "base/bind.h"
#include "base/threading/scoped_blocking_call.h"
#include "build/build_config.h"
#include "components/version_info/android/channel_getter.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
using version_info::Channel;
namespace android_webview {
namespace {
// Gets the version number to use for variations seed simulation. Must be called
// on a thread where IO is allowed.
base::Version GetVersionForSimulation() {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);
return version_info::GetVersion();
}
} // namespace
AwVariationsServiceClient::AwVariationsServiceClient() {}
AwVariationsServiceClient::~AwVariationsServiceClient() {}
base::Callback<base::Version(void)>
AwVariationsServiceClient::GetVersionForSimulationCallback() {
return base::BindRepeating(&GetVersionForSimulation);
}
scoped_refptr<network::SharedURLLoaderFactory>
AwVariationsServiceClient::GetURLLoaderFactory() {
return nullptr;
}
network_time::NetworkTimeTracker*
AwVariationsServiceClient::GetNetworkTimeTracker() {
return nullptr;
}
Channel AwVariationsServiceClient::GetChannel() {
return version_info::android::GetChannel();
}
bool AwVariationsServiceClient::OverridesRestrictParameter(
std::string* parameter) {
return false;
}
} // namespace android_webview