| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 public: | 32 public: |
| 33 DeviceLocalAccountPolicyProvider( | 33 DeviceLocalAccountPolicyProvider( |
| 34 const std::string& user_id, | 34 const std::string& user_id, |
| 35 DeviceLocalAccountPolicyService* service, | 35 DeviceLocalAccountPolicyService* service, |
| 36 std::unique_ptr<PolicyMap> chrome_policy_overrides); | 36 std::unique_ptr<PolicyMap> chrome_policy_overrides); |
| 37 ~DeviceLocalAccountPolicyProvider() override; | 37 ~DeviceLocalAccountPolicyProvider() override; |
| 38 | 38 |
| 39 // Factory function to create and initialize a provider for |user_id|. Returns | 39 // Factory function to create and initialize a provider for |user_id|. Returns |
| 40 // NULL if |user_id| is not a device-local account or user policy isn't | 40 // NULL if |user_id| is not a device-local account or user policy isn't |
| 41 // applicable for user_id's user type. | 41 // applicable for user_id's user type. |
| 42 // If |force_immediate_load| is true then policy is loaded synchronously on |
| 43 // creation. |
| 42 static std::unique_ptr<DeviceLocalAccountPolicyProvider> Create( | 44 static std::unique_ptr<DeviceLocalAccountPolicyProvider> Create( |
| 43 const std::string& user_id, | 45 const std::string& user_id, |
| 44 DeviceLocalAccountPolicyService* service); | 46 DeviceLocalAccountPolicyService* service, |
| 47 bool force_immediate_load); |
| 45 | 48 |
| 46 // ConfigurationPolicyProvider: | 49 // ConfigurationPolicyProvider: |
| 47 bool IsInitializationComplete(PolicyDomain domain) const override; | 50 bool IsInitializationComplete(PolicyDomain domain) const override; |
| 48 void RefreshPolicies() override; | 51 void RefreshPolicies() override; |
| 49 | 52 |
| 50 // DeviceLocalAccountPolicyService::Observer: | 53 // DeviceLocalAccountPolicyService::Observer: |
| 51 void OnPolicyUpdated(const std::string& user_id) override; | 54 void OnPolicyUpdated(const std::string& user_id) override; |
| 52 void OnDeviceLocalAccountsChanged() override; | 55 void OnDeviceLocalAccountsChanged() override; |
| 53 | 56 |
| 54 private: | 57 private: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 77 bool waiting_for_policy_refresh_; | 80 bool waiting_for_policy_refresh_; |
| 78 | 81 |
| 79 base::WeakPtrFactory<DeviceLocalAccountPolicyProvider> weak_factory_; | 82 base::WeakPtrFactory<DeviceLocalAccountPolicyProvider> weak_factory_; |
| 80 | 83 |
| 81 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyProvider); | 84 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyProvider); |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 } // namespace policy | 87 } // namespace policy |
| 85 | 88 |
| 86 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H
_ | 89 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H
_ |
| OLD | NEW |