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

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

Issue 10383262: RefCounted types should not have public destructors, delegate cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make win bot happy Created 8 years, 6 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 <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 20 matching lines...) Expand all
31 // account their priorities. Policy clients can retrieve policy for their domain 31 // account their priorities. Policy clients can retrieve policy for their domain
32 // and register for notifications on policy updates. 32 // and register for notifications on policy updates.
33 // 33 //
34 // The PolicyService is available from BrowserProcess as a global singleton. 34 // The PolicyService is available from BrowserProcess as a global singleton.
35 // There is also a PolicyService for browser-wide policies available from 35 // There is also a PolicyService for browser-wide policies available from
36 // BrowserProcess as a global singleton. 36 // BrowserProcess as a global singleton.
37 class PolicyService { 37 class PolicyService {
38 public: 38 public:
39 class Observer { 39 class Observer {
40 public: 40 public:
41 virtual ~Observer() {}
42
43 // Invoked whenever policies for the |domain|, |component_id| namespace are 41 // Invoked whenever policies for the |domain|, |component_id| namespace are
44 // modified. This is only invoked for changes that happen after AddObserver 42 // modified. This is only invoked for changes that happen after AddObserver
45 // is called. |previous| contains the values of the policies before the 43 // is called. |previous| contains the values of the policies before the
46 // update, and |current| contains the current values. 44 // update, and |current| contains the current values.
47 virtual void OnPolicyUpdated(PolicyDomain domain, 45 virtual void OnPolicyUpdated(PolicyDomain domain,
48 const std::string& component_id, 46 const std::string& component_id,
49 const PolicyMap& previous, 47 const PolicyMap& previous,
50 const PolicyMap& current) = 0; 48 const PolicyMap& current) = 0;
51 49
52 // Invoked at most once, when the PolicyService becomes ready. If 50 // Invoked at most once, when the PolicyService becomes ready. If
53 // IsInitializationComplete() is false, then this will be invoked once all 51 // IsInitializationComplete() is false, then this will be invoked once all
54 // the policy providers are ready. 52 // the policy providers are ready.
55 virtual void OnPolicyServiceInitialized() {} 53 virtual void OnPolicyServiceInitialized() {}
54
55 protected:
56 virtual ~Observer() {}
56 }; 57 };
57 58
58 virtual ~PolicyService() {} 59 virtual ~PolicyService() {}
59 60
60 virtual void AddObserver(PolicyDomain domain, 61 virtual void AddObserver(PolicyDomain domain,
61 const std::string& component_id, 62 const std::string& component_id,
62 Observer* observer) = 0; 63 Observer* observer) = 0;
63 64
64 virtual void RemoveObserver(PolicyDomain domain, 65 virtual void RemoveObserver(PolicyDomain domain,
65 const std::string& component_id, 66 const std::string& component_id,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 PolicyDomain domain_; 123 PolicyDomain domain_;
123 std::string component_id_; 124 std::string component_id_;
124 CallbackMap callback_map_; 125 CallbackMap callback_map_;
125 126
126 DISALLOW_COPY_AND_ASSIGN(PolicyChangeRegistrar); 127 DISALLOW_COPY_AND_ASSIGN(PolicyChangeRegistrar);
127 }; 128 };
128 129
129 } // namespace policy 130 } // namespace policy
130 131
131 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ 132 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/nacl_host/nacl_process_host.cc ('k') | chrome/browser/safe_browsing/safe_browsing_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698