#include "chrome/updater/policy/policy_manager.h"
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include "base/containers/flat_set.h"
#include "base/logging.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "chrome/updater/policy/manager.h"
#include "chrome/updater/updater_scope.h"
namespace updater {
namespace {
constexpr char kCloudPolicyOverridesPlatformPolicy[] = …;
constexpr char kAutoUpdateCheckPeriodOverrideMinutes[] = …;
constexpr char kUpdatesSuppressedStartHour[] = …;
constexpr char kUpdatesSuppressedStartMin[] = …;
constexpr char kUpdatesSuppressedDurationMin[] = …;
constexpr char kDownloadPreference[] = …;
constexpr char kProxyMode[] = …;
constexpr char kProxyServer[] = …;
constexpr char kProxyPacUrl[] = …;
constexpr char kCacheSizeLimitMBytes[] = …;
constexpr char kCacheLifeLimitDays[] = …;
constexpr char kInstallAppsDefault[] = …;
constexpr char kInstallAppPrefix[] = …;
constexpr char kUpdateAppsDefault[] = …;
constexpr char kUpdateAppPrefix[] = …;
constexpr char kTargetVersionPrefix[] = …;
constexpr char kTargetChannel[] = …;
constexpr char kRollbackToTargetVersion[] = …;
}
PolicyManager::PolicyManager(base::Value::Dict policies)
: … { … }
PolicyManager::~PolicyManager() = default;
std::optional<bool> PolicyManager::CloudPolicyOverridesPlatformPolicy() const { … }
bool PolicyManager::HasActiveDevicePolicies() const { … }
std::string PolicyManager::source() const { … }
std::optional<base::TimeDelta> PolicyManager::GetLastCheckPeriod() const { … }
std::optional<UpdatesSuppressedTimes> PolicyManager::GetUpdatesSuppressedTimes()
const { … }
std::optional<std::string> PolicyManager::GetDownloadPreference() const { … }
std::optional<int> PolicyManager::GetPackageCacheSizeLimitMBytes() const { … }
std::optional<int> PolicyManager::GetPackageCacheExpirationTimeDays() const { … }
std::optional<int> PolicyManager::GetEffectivePolicyForAppInstalls(
const std::string& app_id) const { … }
std::optional<int> PolicyManager::GetEffectivePolicyForAppUpdates(
const std::string& app_id) const { … }
std::optional<std::string> PolicyManager::GetTargetChannel(
const std::string& app_id) const { … }
std::optional<std::string> PolicyManager::GetTargetVersionPrefix(
const std::string& app_id) const { … }
std::optional<bool> PolicyManager::IsRollbackToTargetVersionAllowed(
const std::string& app_id) const { … }
std::optional<std::string> PolicyManager::GetProxyMode() const { … }
std::optional<std::string> PolicyManager::GetProxyPacUrl() const { … }
std::optional<std::string> PolicyManager::GetProxyServer() const { … }
std::optional<std::vector<std::string>> PolicyManager::GetForceInstallApps()
const { … }
std::optional<std::vector<std::string>> PolicyManager::GetAppsWithPolicy()
const { … }
std::optional<int> PolicyManager::GetIntegerPolicy(
const std::string& key) const { … }
std::optional<std::string> PolicyManager::GetStringPolicy(
const std::string& key) const { … }
}