#include "components/supervised_user/core/browser/list_family_members_service.h"
#include <memory>
#include <utility>
#include "base/callback_list.h"
#include "base/functional/callback_forward.h"
#include "base/location.h"
#include "base/memory/scoped_refptr.h"
#include "base/time/time.h"
#include "components/prefs/pref_service.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/supervised_user/core/browser/kids_management_api_fetcher.h"
#include "components/supervised_user/core/browser/proto/kidsmanagement_messages.pb.h"
#include "components/supervised_user/core/browser/supervised_user_utils.h"
#include "components/supervised_user/core/common/features.h"
#include "components/supervised_user/core/common/pref_names.h"
#include "components/supervised_user/core/common/supervised_user_constants.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace supervised_user {
namespace {
constexpr base::TimeDelta kDefaultUpdateInterval = …;
constexpr base::TimeDelta kOnErrorUpdateInterval = …;
base::TimeDelta NextUpdate(const ProtoFetcherStatus& status) { … }
}
ListFamilyMembersService::ListFamilyMembersService(
signin::IdentityManager* identity_manager,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
PrefService& user_prefs)
: … { … }
ListFamilyMembersService::~ListFamilyMembersService() = default;
base::CallbackListSubscription
ListFamilyMembersService::SubscribeToSuccessfulFetches(
base::RepeatingCallback<SuccessfulFetchCallback> callback) { … }
void ListFamilyMembersService::Init() { … }
void ListFamilyMembersService::Shutdown() { … }
void ListFamilyMembersService::StartRepeatedFetch() { … }
void ListFamilyMembersService::StopFetch() { … }
void ListFamilyMembersService::OnExtendedAccountInfoUpdated(
const AccountInfo& info) { … }
void ListFamilyMembersService::OnPrimaryAccountChanged(
const signin::PrimaryAccountChangeEvent& event_details) { … }
void ListFamilyMembersService::OnResponse(
const ProtoFetcherStatus& status,
std::unique_ptr<kidsmanagement::ListMembersResponse> response) { … }
void ListFamilyMembersService::ScheduleNextUpdate(base::TimeDelta delay) { … }
void ListFamilyMembersService::SetFamilyMemberPrefs(
const kidsmanagement::ListMembersResponse& list_members_response) { … }
}