| 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_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ | 6 #define CHROME_BROWSER_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // DeviceLocalAccountPolicyService::Observer: | 35 // DeviceLocalAccountPolicyService::Observer: |
| 36 virtual void OnPolicyUpdated(const std::string& account_id) OVERRIDE; | 36 virtual void OnPolicyUpdated(const std::string& account_id) OVERRIDE; |
| 37 virtual void OnDeviceLocalAccountsChanged() OVERRIDE; | 37 virtual void OnDeviceLocalAccountsChanged() OVERRIDE; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 // Returns the broker for |account_id_| or NULL if not available. | 40 // Returns the broker for |account_id_| or NULL if not available. |
| 41 DeviceLocalAccountPolicyBroker* GetBroker(); | 41 DeviceLocalAccountPolicyBroker* GetBroker(); |
| 42 | 42 |
| 43 // Handles completion of policy refreshes and triggers the update callback. | 43 // Handles completion of policy refreshes and triggers the update callback. |
| 44 void ReportPolicyRefresh(); | 44 // |success| is true if the policy refresh was successful. |
| 45 void ReportPolicyRefresh(bool success); |
| 45 | 46 |
| 46 // Unless |waiting_for_policy_refresh_|, calls UpdatePolicy(), using the | 47 // Unless |waiting_for_policy_refresh_|, calls UpdatePolicy(), using the |
| 47 // policy from the broker if available or keeping the current policy. | 48 // policy from the broker if available or keeping the current policy. |
| 48 void UpdateFromBroker(); | 49 void UpdateFromBroker(); |
| 49 | 50 |
| 50 const std::string account_id_; | 51 const std::string account_id_; |
| 51 DeviceLocalAccountPolicyService* service_; | 52 DeviceLocalAccountPolicyService* service_; |
| 52 | 53 |
| 53 bool store_initialized_; | 54 bool store_initialized_; |
| 54 bool waiting_for_policy_refresh_; | 55 bool waiting_for_policy_refresh_; |
| 55 | 56 |
| 56 base::WeakPtrFactory<DeviceLocalAccountPolicyProvider> weak_factory_; | 57 base::WeakPtrFactory<DeviceLocalAccountPolicyProvider> weak_factory_; |
| 57 | 58 |
| 58 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyProvider); | 59 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyProvider); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 } // namespace policy | 62 } // namespace policy |
| 62 | 63 |
| 63 #endif // CHROME_BROWSER_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ | 64 #endif // CHROME_BROWSER_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ |
| OLD | NEW |