blob: 24a3f1f2306aef729f6875c43d1e1d07eb1f46bf [file] [log] [blame]
Alex Deymoc83baf62014-04-02 17:43:35 -07001// 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
5#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_DEVICE_POLICY_PROVIDER_H_
6#define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_DEVICE_POLICY_PROVIDER_H_
7
8#include <set>
9#include <string>
10
11#include <policy/libpolicy.h>
12#include <base/time/time.h>
13
14#include "update_engine/policy_manager/provider.h"
15#include "update_engine/policy_manager/shill_provider.h"
16#include "update_engine/policy_manager/variable.h"
17
18namespace chromeos_policy_manager {
19
20// Provides access to the current DevicePolicy.
21class DevicePolicyProvider : public Provider {
22 public:
23 virtual ~DevicePolicyProvider() {}
24
25 // Variable stating whether the DevicePolicy was loaded.
26 virtual Variable<bool>* var_device_policy_is_loaded() = 0;
27
28 // Variables mapping the information received on the DevicePolicy protobuf.
29 virtual Variable<std::string>* var_release_channel() = 0;
30
31 virtual Variable<bool>* var_release_channel_delegated() = 0;
32
33 virtual Variable<bool>* var_update_disabled() = 0;
34
35 virtual Variable<std::string>* var_target_version_prefix() = 0;
36
37 virtual Variable<base::TimeDelta>* var_scatter_factor() = 0;
38
39 // Variable returing the set of connection types allowed for updates. The
40 // identifiers returned are consistent with the ones returned by the
41 // ShillProvider.
42 virtual Variable<std::set<ConnectionType>>*
43 var_allowed_connection_types_for_update() = 0;
44
45 // Variable stating the name of the device owner. For enterprise enrolled
46 // devices, this will be an empty string.
47 virtual Variable<std::string>* var_get_owner() = 0;
48
49 virtual Variable<bool>* var_http_downloads_enabled() = 0;
50
51 virtual Variable<bool>* var_au_p2p_enabled() = 0;
52
53 protected:
54 DevicePolicyProvider() {}
55
56 private:
57 DISALLOW_COPY_AND_ASSIGN(DevicePolicyProvider);
58};
59
60} // namespace chromeos_policy_manager
61
62#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_DEVICE_POLICY_PROVIDER_H_