diff options
Diffstat (limited to 'chrome/browser/policy/mock_configuration_policy_provider.cc')
-rw-r--r-- | chrome/browser/policy/mock_configuration_policy_provider.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/chrome/browser/policy/mock_configuration_policy_provider.cc b/chrome/browser/policy/mock_configuration_policy_provider.cc index 4f11497..a2566b0 100644 --- a/chrome/browser/policy/mock_configuration_policy_provider.cc +++ b/chrome/browser/policy/mock_configuration_policy_provider.cc @@ -4,13 +4,15 @@ #include "chrome/browser/policy/mock_configuration_policy_provider.h" +#include "base/stl_util-inl.h" #include "chrome/browser/policy/configuration_policy_pref_store.h" namespace policy { MockConfigurationPolicyProvider::MockConfigurationPolicyProvider() : ConfigurationPolicyProvider( - ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList()) { + ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList()), + initialization_complete_(false) { } MockConfigurationPolicyProvider::~MockConfigurationPolicyProvider() { @@ -23,6 +25,20 @@ void MockConfigurationPolicyProvider::AddPolicy(ConfigurationPolicyType policy, delete value; } +void MockConfigurationPolicyProvider::RemovePolicy( + ConfigurationPolicyType policy) { + const PolicyMap::iterator entry = policy_map_.find(policy); + if (entry != policy_map_.end()) { + delete entry->second; + policy_map_.erase(entry); + } +} + +void MockConfigurationPolicyProvider::SetInitializationComplete( + bool initialization_complete) { + initialization_complete_ = initialization_complete; +} + bool MockConfigurationPolicyProvider::Provide( ConfigurationPolicyStoreInterface* store) { for (PolicyMap::const_iterator current = policy_map_.begin(); @@ -32,4 +48,8 @@ bool MockConfigurationPolicyProvider::Provide( return true; } +bool MockConfigurationPolicyProvider::IsInitializationComplete() const { + return initialization_complete_; +} + } |