#include "components/supervised_user/core/browser/permission_request_creator_impl.h"
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "components/supervised_user/core/browser/fetcher_config.h"
#include "components/supervised_user/core/browser/kids_management_api_fetcher.h"
#include "components/supervised_user/core/browser/proto/kidsmanagement_messages.pb.h"
namespace supervised_user {
namespace {
void DispatchResult(bool success,
PermissionRequestCreator::SuccessCallback callback) { … }
bool ValidateResponse(
const kidsmanagement::CreatePermissionRequestResponse& response) { … }
void OnSuccess(const kidsmanagement::CreatePermissionRequestResponse& response,
PermissionRequestCreator::SuccessCallback callback) { … }
void OnFailure(const ProtoFetcherStatus& error,
PermissionRequestCreator::SuccessCallback callback) { … }
void OnResponse(
PermissionRequestCreator::SuccessCallback callback,
const ProtoFetcherStatus& status,
std::unique_ptr<kidsmanagement::CreatePermissionRequestResponse> response) { … }
std::unique_ptr<ProtoFetcher<kidsmanagement::CreatePermissionRequestResponse>>
FetcherFactory(
signin::IdentityManager* identity_manager,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const FetcherConfig& config,
const kidsmanagement::PermissionRequest& request) { … }
}
PermissionRequestCreatorImpl::PermissionRequestCreatorImpl(
signin::IdentityManager* identity_manager,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
: … { … }
PermissionRequestCreatorImpl::~PermissionRequestCreatorImpl() = default;
bool PermissionRequestCreatorImpl::IsEnabled() const { … }
void PermissionRequestCreatorImpl::CreateURLAccessRequest(
const GURL& url_requested,
SuccessCallback callback) { … }
}