Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: chrome/browser/policy/policy_service.h

Issue 10174003: Pass the previous and the current PolicyMap to Observers of the PolicyService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_pref_store.cc ('k') | chrome/browser/policy/policy_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698