blob: f6bbe2e29989fd6e79b975262f9624be7648ac99 [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
Gilad Arnoldf62a4b82014-05-01 07:41:07 -070037 // Returns a non-negative scatter interval used for updates.
Alex Deymoc83baf62014-04-02 17:43:35 -070038 virtual Variable<base::TimeDelta>* var_scatter_factor() = 0;
39
40 // Variable returing the set of connection types allowed for updates. The
41 // identifiers returned are consistent with the ones returned by the
42 // ShillProvider.
43 virtual Variable<std::set<ConnectionType>>*
44 var_allowed_connection_types_for_update() = 0;
45
46 // Variable stating the name of the device owner. For enterprise enrolled
47 // devices, this will be an empty string.
48 virtual Variable<std::string>* var_get_owner() = 0;
49
50 virtual Variable<bool>* var_http_downloads_enabled() = 0;
51
52 virtual Variable<bool>* var_au_p2p_enabled() = 0;
53
54 protected:
55 DevicePolicyProvider() {}
56
57 private:
58 DISALLOW_COPY_AND_ASSIGN(DevicePolicyProvider);
59};
60
61} // namespace chromeos_policy_manager
62
63#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_DEVICE_POLICY_PROVIDER_H_