| Index: chrome/browser/chromeos/policy/device_local_account_policy_service.h
|
| diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_service.h b/chrome/browser/chromeos/policy/device_local_account_policy_service.h
|
| index 2f9e776c1910a7346492d92bde92a21e7470b2c0..f91fc95f22ea039e1e61ee9910cf8d0606197848 100644
|
| --- a/chrome/browser/chromeos/policy/device_local_account_policy_service.h
|
| +++ b/chrome/browser/chromeos/policy/device_local_account_policy_service.h
|
| @@ -11,6 +11,7 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/compiler_specific.h"
|
| +#include "base/files/file_path.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/memory/weak_ptr.h"
|
| @@ -48,6 +49,7 @@ class DeviceLocalAccountPolicyBroker {
|
| // |task_runner| is the runner for policy refresh tasks.
|
| DeviceLocalAccountPolicyBroker(
|
| const DeviceLocalAccount& account,
|
| + const base::FilePath& component_policy_cache_path,
|
| scoped_ptr<DeviceLocalAccountPolicyStore> store,
|
| scoped_refptr<DeviceLocalAccountExternalDataManager>
|
| external_data_manager,
|
| @@ -86,9 +88,15 @@ class DeviceLocalAccountPolicyBroker {
|
| // empty string if the policy is not present.
|
| std::string GetDisplayName() const;
|
|
|
| + // Returns a directory where component policy for this account can be cached.
|
| + // The DeviceLocalAccountPolicyService takes care of cleaning up caches of
|
| + // accounts that have been removed.
|
| + base::FilePath GetComponentPolicyCachePath() const;
|
| +
|
| private:
|
| const std::string account_id_;
|
| const std::string user_id_;
|
| + const base::FilePath component_policy_cache_path_;
|
| const scoped_ptr<DeviceLocalAccountPolicyStore> store_;
|
| scoped_refptr<DeviceLocalAccountExternalDataManager> external_data_manager_;
|
| scoped_refptr<chromeos::DeviceLocalAccountExternalPolicyLoader>
|
| @@ -114,6 +122,9 @@ class DeviceLocalAccountPolicyService : public CloudPolicyStore::Observer {
|
|
|
| // The list of accounts has been updated.
|
| virtual void OnDeviceLocalAccountsChanged() = 0;
|
| +
|
| + // The given |broker| is about to be destroyed.
|
| + virtual void OnBrokerShutdown(DeviceLocalAccountPolicyBroker* broker) {}
|
| };
|
|
|
| DeviceLocalAccountPolicyService(
|
| @@ -142,6 +153,8 @@ class DeviceLocalAccountPolicyService : public CloudPolicyStore::Observer {
|
| // |user_id|.
|
| bool IsPolicyAvailableForUser(const std::string& user_id);
|
|
|
| + scoped_refptr<net::URLRequestContextGetter> request_context() const;
|
| +
|
| void AddObserver(Observer* observer);
|
| void RemoveObserver(Observer* observer);
|
|
|
| @@ -229,6 +242,10 @@ class DeviceLocalAccountPolicyService : public CloudPolicyStore::Observer {
|
| const scoped_ptr<chromeos::CrosSettings::ObserverSubscription>
|
| local_accounts_subscription_;
|
|
|
| + // Path to the directory that contains the cached policies for components
|
| + // for device local accounts.
|
| + base::FilePath component_policy_cache_root_;
|
| +
|
| base::WeakPtrFactory<DeviceLocalAccountPolicyService> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyService);
|
|
|