#include "components/policy/core/browser/webui/policy_status_provider.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/i18n/time_formatting.h"
#include "base/no_destructor.h"
#include "base/time/clock.h"
#include "base/time/default_clock.h"
#include "base/time/time.h"
#include "base/values.h"
#include "components/policy/core/browser/cloud/message_util.h"
#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include "components/policy/core/common/cloud/cloud_policy_core.h"
#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/time_format.h"
em;
namespace policy {
namespace {
std::u16string FormatAssociationState(const em::PolicyData* data) { … }
base::Clock* clock_for_testing_ = …;
const base::Clock* GetClock() { … }
}
PolicyStatusProvider::PolicyStatusProvider() = default;
PolicyStatusProvider::~PolicyStatusProvider() = default;
void PolicyStatusProvider::AddObserver(Observer* observer) { … }
void PolicyStatusProvider::RemoveObserver(Observer* observer) { … }
base::Value::Dict PolicyStatusProvider::GetStatus() { … }
void PolicyStatusProvider::NotifyStatusChange() { … }
base::Value::Dict PolicyStatusProvider::GetStatusFromCore(
const CloudPolicyCore* core) { … }
base::Value::Dict PolicyStatusProvider::GetStatusFromPolicyData(
const em::PolicyData* policy) { … }
void PolicyStatusProvider::UpdateLastReportTimestamp(
base::Value::Dict& status,
PrefService* prefs,
const std::string& report_timestamp_pref_path) { … }
std::u16string PolicyStatusProvider::GetPolicyStatusFromStore(
const CloudPolicyStore* store,
const CloudPolicyClient* client) { … }
std::u16string PolicyStatusProvider::GetTimeSinceLastActionString(
base::Time last_action_time) { … }
base::ScopedClosureRunner PolicyStatusProvider::OverrideClockForTesting(
base::Clock* clock_for_testing) { … }
}