chromium/chrome/updater/policy/policy_manager.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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[] =;

// Preferences Category.
constexpr char kAutoUpdateCheckPeriodOverrideMinutes[] =;
constexpr char kUpdatesSuppressedStartHour[] =;
constexpr char kUpdatesSuppressedStartMin[] =;
constexpr char kUpdatesSuppressedDurationMin[] =;

// This policy specifies what kind of download URLs could be returned to the
// client in the update response and in which order of priority. The client
// provides this information in the update request as a hint for the server.
// The server may decide to ignore the hint. As a general idea, some urls are
// cacheable, some urls have higher bandwidth, and some urls are slightly more
// secure since they are https.
constexpr char kDownloadPreference[] =;

// Proxy Server Category.  (The keys used, and the values of ProxyMode,
// directly mirror that of Chrome.  However, we omit ProxyBypassList, as the
// domains that Omaha uses are largely fixed.)
constexpr char kProxyMode[] =;
constexpr char kProxyServer[] =;
constexpr char kProxyPacUrl[] =;

// Package cache constants.
constexpr char kCacheSizeLimitMBytes[] =;
constexpr char kCacheLifeLimitDays[] =;

// Applications Category.
// The prefix strings have the app's GUID appended to them.
constexpr char kInstallAppsDefault[] =;
constexpr char kInstallAppPrefix[] =;
constexpr char kUpdateAppsDefault[] =;
constexpr char kUpdateAppPrefix[] =;
constexpr char kTargetVersionPrefix[] =;
constexpr char kTargetChannel[] =;
constexpr char kRollbackToTargetVersion[] =;

}  // namespace

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 {}
}  // namespace updater