| 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..9bf7935e70547556da3387e177da68710a16d6dd 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,36 @@ 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_;
|
|
|
| + // Whether a policy refresh is in progress (and thus any further requests need
|
| + // to be blocked).
|
| + bool refresh_in_progress_ = false;
|
| + // Whether a refresh had been blocked and thus the next refresh needs to be
|
| + // scheduled at the shorter "retry" interval.
|
| + bool retry_refresh_ = false;
|
| + base::TimeTicks last_refresh_;
|
| + const base::TimeTicks startup_ = base::TimeTicks::Now();
|
| + std::unique_ptr<base::CancelableClosure> refresh_task_;
|
| +
|
| // Must be last member.
|
| base::WeakPtrFactory<ActiveDirectoryPolicyManager> weak_ptr_factory_;
|
|
|
|
|