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_STUB_H_ | 5 #ifndef CHROME_BROWSER_POLICY_POLICY_SERVICE_STUB_H_ |
6 #define CHROME_BROWSER_POLICY_POLICY_SERVICE_STUB_H_ | 6 #define CHROME_BROWSER_POLICY_POLICY_SERVICE_STUB_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "chrome/browser/policy/policy_map.h" |
10 #include "chrome/browser/policy/policy_service.h" | 11 #include "chrome/browser/policy/policy_service.h" |
11 | 12 |
12 namespace policy { | 13 namespace policy { |
13 | 14 |
14 // A stub implementation, that is used when ENABLE_CONFIGURATION_POLICY is not | 15 // A stub implementation, that is used when ENABLE_CONFIGURATION_POLICY is not |
15 // set. This allows client code to compile without requiring #ifdefs. | 16 // set. This allows client code to compile without requiring #ifdefs. |
16 class PolicyServiceStub : public PolicyService { | 17 class PolicyServiceStub : public PolicyService { |
17 public: | 18 public: |
18 PolicyServiceStub(); | 19 PolicyServiceStub(); |
19 virtual ~PolicyServiceStub(); | 20 virtual ~PolicyServiceStub(); |
20 | 21 |
21 virtual void AddObserver(PolicyDomain domain, | 22 virtual void AddObserver(PolicyDomain domain, |
22 const std::string& component_id, | 23 const std::string& component_id, |
23 Observer* observer) OVERRIDE; | 24 Observer* observer) OVERRIDE; |
24 | 25 |
25 virtual void RemoveObserver(PolicyDomain domain, | 26 virtual void RemoveObserver(PolicyDomain domain, |
26 const std::string& component_id, | 27 const std::string& component_id, |
27 Observer* observer) OVERRIDE; | 28 Observer* observer) OVERRIDE; |
28 | 29 |
29 virtual const PolicyMap* GetPolicies( | 30 virtual const PolicyMap& GetPolicies( |
30 PolicyDomain domain, | 31 PolicyDomain domain, |
31 const std::string& component_id) const OVERRIDE; | 32 const std::string& component_id) const OVERRIDE; |
32 | 33 |
33 virtual bool IsInitializationComplete() const OVERRIDE; | 34 virtual bool IsInitializationComplete() const OVERRIDE; |
34 | 35 |
35 virtual void RefreshPolicies(const base::Closure& callback) OVERRIDE; | 36 virtual void RefreshPolicies(const base::Closure& callback) OVERRIDE; |
36 private: | 37 private: |
| 38 const PolicyMap kEmpty_; |
| 39 |
37 DISALLOW_COPY_AND_ASSIGN(PolicyServiceStub); | 40 DISALLOW_COPY_AND_ASSIGN(PolicyServiceStub); |
38 }; | 41 }; |
39 | 42 |
40 } // namespace policy | 43 } // namespace policy |
41 | 44 |
42 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_STUB_H_ | 45 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_STUB_H_ |
OLD | NEW |