| 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_POLICY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ |
| 6 #define CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ | 6 #define CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // | 27 // |
| 28 // The PolicyService is available from BrowserProcess as a global singleton. | 28 // The PolicyService is available from BrowserProcess as a global singleton. |
| 29 class PolicyService { | 29 class PolicyService { |
| 30 public: | 30 public: |
| 31 class Observer { | 31 class Observer { |
| 32 public: | 32 public: |
| 33 virtual ~Observer() {} | 33 virtual ~Observer() {} |
| 34 | 34 |
| 35 // Invoked whenever policies for the |domain|, |component_id| namespace are | 35 // Invoked whenever policies for the |domain|, |component_id| namespace are |
| 36 // modified. This is only invoked for changes that happen after AddObserver | 36 // modified. This is only invoked for changes that happen after AddObserver |
| 37 // is called. | 37 // is called. |previous| contains the values of the policies before the |
| 38 // update, and |current| contains the current values. |
| 38 virtual void OnPolicyUpdated(PolicyDomain domain, | 39 virtual void OnPolicyUpdated(PolicyDomain domain, |
| 39 const std::string& component_id) = 0; | 40 const std::string& component_id, |
| 41 const PolicyMap& previous, |
| 42 const PolicyMap& current) = 0; |
| 40 | 43 |
| 41 // Invoked at most once, when the PolicyService becomes ready. If | 44 // Invoked at most once, when the PolicyService becomes ready. If |
| 42 // IsInitializationComplete() is false, then this will be invoked once all | 45 // IsInitializationComplete() is false, then this will be invoked once all |
| 43 // the policy providers are ready. | 46 // the policy providers are ready. |
| 44 virtual void OnPolicyServiceInitialized() {} | 47 virtual void OnPolicyServiceInitialized() {} |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 virtual ~PolicyService() {} | 50 virtual ~PolicyService() {} |
| 48 | 51 |
| 49 virtual void AddObserver(PolicyDomain domain, | 52 virtual void AddObserver(PolicyDomain domain, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 68 // OnPolicyServiceInitialized() is called when IsInitializationComplete() | 71 // OnPolicyServiceInitialized() is called when IsInitializationComplete() |
| 69 // becomes true, which happens at most once. If IsInitializationComplete() is | 72 // becomes true, which happens at most once. If IsInitializationComplete() is |
| 70 // already true when an Observer is registered, then that Observer will not | 73 // already true when an Observer is registered, then that Observer will not |
| 71 // have a OnPolicyServiceInitialized() notification. | 74 // have a OnPolicyServiceInitialized() notification. |
| 72 virtual bool IsInitializationComplete() const = 0; | 75 virtual bool IsInitializationComplete() const = 0; |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 } // namespace policy | 78 } // namespace policy |
| 76 | 79 |
| 77 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ | 80 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ |
| OLD | NEW |