blob: 1eeb54ba95b45727e0f476c21263bf915806664a [file] [log] [blame]
Alex Deymoc705cc82014-02-19 11:15:00 -08001// Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Gilad Arnold2cbb3852014-03-07 12:40:50 -08005#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_DEFAULT_POLICY_H_
6#define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_DEFAULT_POLICY_H_
Alex Deymoc705cc82014-02-19 11:15:00 -08007
8#include "update_engine/policy_manager/policy.h"
9
10namespace chromeos_policy_manager {
11
12// The DefaultPolicy is a safe Policy implementation that doesn't fail. The
13// values returned by this policy are safe default in case of failure of the
14// actual policy being used by the PolicyManager.
15class DefaultPolicy : public Policy {
16 public:
17 DefaultPolicy() {}
18 virtual ~DefaultPolicy() {}
19
20 // Policy overrides.
Alex Deymo2de23f52014-02-26 14:30:13 -080021 virtual EvalStatus UpdateCheckAllowed(EvaluationContext* ec, State* state,
Alex Deymoc705cc82014-02-19 11:15:00 -080022 std::string* error,
Gilad Arnoldaf2f6ae2014-04-28 14:14:52 -070023 bool* result) const override {
24 *result = true;
25 return EvalStatus::kSucceeded;
26 }
27
28 virtual EvalStatus UpdateDownloadAndApplyAllowed(
29 EvaluationContext* ec, State* state, std::string* error,
30 bool* result) const override {
Alex Deymoc705cc82014-02-19 11:15:00 -080031 *result = true;
Alex Deymoe636c3c2014-03-11 19:02:08 -070032 return EvalStatus::kSucceeded;
Alex Deymoc705cc82014-02-19 11:15:00 -080033 }
34
35 private:
36 DISALLOW_COPY_AND_ASSIGN(DefaultPolicy);
37};
38
39} // namespace chromeos_policy_manager
40
Gilad Arnold2cbb3852014-03-07 12:40:50 -080041#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_DEFAULT_POLICY_H_