Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 1 | // 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 Arnold | 48415f1 | 2014-06-27 07:10:58 -0700 | [diff] [blame^] | 5 | #ifndef UPDATE_ENGINE_UPDATE_MANAGER_DEVICE_POLICY_PROVIDER_H_ |
| 6 | #define UPDATE_ENGINE_UPDATE_MANAGER_DEVICE_POLICY_PROVIDER_H_ |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 7 | |
| 8 | #include <set> |
| 9 | #include <string> |
| 10 | |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 11 | #include <base/time/time.h> |
Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 12 | #include <policy/libpolicy.h> |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 13 | |
Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 14 | #include "update_engine/update_manager/provider.h" |
| 15 | #include "update_engine/update_manager/shill_provider.h" |
| 16 | #include "update_engine/update_manager/variable.h" |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 17 | |
Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 18 | namespace chromeos_update_manager { |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 19 | |
| 20 | // Provides access to the current DevicePolicy. |
| 21 | class 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 Arnold | f62a4b8 | 2014-05-01 07:41:07 -0700 | [diff] [blame] | 37 | // Returns a non-negative scatter interval used for updates. |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 38 | 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 | |
Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 61 | } // namespace chromeos_update_manager |
Alex Deymo | c83baf6 | 2014-04-02 17:43:35 -0700 | [diff] [blame] | 62 | |
Gilad Arnold | 48415f1 | 2014-06-27 07:10:58 -0700 | [diff] [blame^] | 63 | #endif // UPDATE_ENGINE_UPDATE_MANAGER_DEVICE_POLICY_PROVIDER_H_ |