#include "chrome/browser/policy/messaging_layer/util/user_dm_token_retriever.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/ptr_util.h"
#include "base/task/thread_pool.h"
#include "base/types/expected.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/policy/dm_token_utils.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "components/policy/core/common/cloud/dm_token.h"
#include "components/reporting/client/dm_token_retriever.h"
#include "components/reporting/util/statusor.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
namespace reporting {
namespace {
policy::DMToken GetDMToken(
const UserDMTokenRetriever::ProfileRetrievalCallback profile_retrieval_cb) { … }
Profile* GetUserProfile() { … }
void OnDMTokenRetrieved(DMTokenRetriever::CompletionCallback completion_cb,
const policy::DMToken& dm_token) { … }
}
UserDMTokenRetriever::UserDMTokenRetriever(
UserDMTokenRetriever::ProfileRetrievalCallback profile_retrieval_cb)
: … { … }
UserDMTokenRetriever::~UserDMTokenRetriever() = default;
std::unique_ptr<UserDMTokenRetriever> UserDMTokenRetriever::Create() { … }
std::unique_ptr<UserDMTokenRetriever> UserDMTokenRetriever::CreateForTest(
UserDMTokenRetriever::ProfileRetrievalCallback profile_retrieval_cb) { … }
void UserDMTokenRetriever::RetrieveDMToken(
DMTokenRetriever::CompletionCallback completion_cb) { … }
}