OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_MOCK_CONFIGURATION_POLICY_STORE_H_ |
| 6 #define CHROME_BROWSER_MOCK_CONFIGURATION_POLICY_STORE_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/stl_util-inl.h" |
| 11 #include "chrome/browser/configuration_policy_store.h" |
| 12 |
| 13 // Mock ConfigurationPolicyStore implementation that records values for policy |
| 14 // settings as they get set. |
| 15 class MockConfigurationPolicyStore : public ConfigurationPolicyStore { |
| 16 public: |
| 17 MockConfigurationPolicyStore() {} |
| 18 ~MockConfigurationPolicyStore() { |
| 19 STLDeleteValues(&policy_map_); |
| 20 } |
| 21 |
| 22 typedef std::map<ConfigurationPolicyStore::PolicyType, Value*> PolicyMap; |
| 23 const PolicyMap& policy_map() { return policy_map_; } |
| 24 |
| 25 // ConfigurationPolicyStore implementation. |
| 26 virtual void Apply(PolicyType policy, Value* value) { |
| 27 policy_map_[policy] = value; |
| 28 } |
| 29 |
| 30 private: |
| 31 PolicyMap policy_map_; |
| 32 }; |
| 33 |
| 34 #endif // CHROME_BROWSER_MOCK_CONFIGURATION_POLICY_STORE_H_ |
OLD | NEW |