Chromium Code Reviews| Index: chrome/browser/chromeos/policy/active_directory_policy_manager.h |
| diff --git a/chrome/browser/chromeos/policy/active_directory_policy_manager.h b/chrome/browser/chromeos/policy/active_directory_policy_manager.h |
| index 96fcac33a2de9e3e62308b05525d37081af42d2c..46099b999451df18854d3f8510caed96b239b3b0 100644 |
| --- a/chrome/browser/chromeos/policy/active_directory_policy_manager.h |
| +++ b/chrome/browser/chromeos/policy/active_directory_policy_manager.h |
| @@ -7,8 +7,10 @@ |
| #include <memory> |
| +#include "base/cancelable_callback.h" |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "base/time/time.h" |
| #include "components/policy/core/common/cloud/cloud_policy_store.h" |
| #include "components/policy/core/common/configuration_policy_provider.h" |
| #include "components/signin/core/account_id/account_id.h" |
| @@ -52,15 +54,31 @@ class ActiveDirectoryPolicyManager : public ConfigurationPolicyProvider, |
| ActiveDirectoryPolicyManager(const AccountId& account_id, |
| std::unique_ptr<CloudPolicyStore> store); |
| - // Publishes the policy that's currently cached in the store. |
| + // Publish the policy that's currently cached in the store. |
| void PublishPolicy(); |
| // Callback from authpolicyd. |
| void OnPolicyRefreshed(bool success); |
| + // Schedule next policy refresh to run after |delay|. (Deletes any previously |
| + // scheduled refresh tasks.) |
| + void ScheduleRefresh(base::TimeDelta delay); |
| + |
| + // Schedule next automatic policy refresh based on initial fetch delay or |
| + // refresh interval. (Deletes any previously scheduled refresh tasks.) |
| + void ScheduleAutomaticRefresh(); |
| + |
| + // Actually execute the scheduled policy refresh. |
| + void RunScheduledRefresh(); |
| + |
| const AccountId account_id_; |
| std::unique_ptr<CloudPolicyStore> store_; |
| + base::TimeTicks startup_ = base::TimeTicks::Now(); |
|
emaxx
2017/01/26 20:54:02
nit: const?
Thiemo Nagel
2017/01/27 10:55:35
Done.
|
| + base::TimeTicks last_refresh_{}; |
|
emaxx
2017/01/26 20:54:02
nit: Can the bracket initialization be omitted her
Thiemo Nagel
2017/01/27 10:55:35
Sure.
|
| + bool refresh_in_progress_ = false; |
| + std::unique_ptr<base::CancelableClosure> refresh_task_; |
| + |
| // Must be last member. |
| base::WeakPtrFactory<ActiveDirectoryPolicyManager> weak_ptr_factory_; |