diff options
Diffstat (limited to 'chrome/browser/policy/policy_service_impl.cc')
-rw-r--r-- | chrome/browser/policy/policy_service_impl.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/policy/policy_service_impl.cc b/chrome/browser/policy/policy_service_impl.cc index 4604f75..7820559 100644 --- a/chrome/browser/policy/policy_service_impl.cc +++ b/chrome/browser/policy/policy_service_impl.cc @@ -9,14 +9,17 @@ #include "base/bind.h" #include "base/message_loop/message_loop.h" #include "base/stl_util.h" -#include "chrome/browser/policy/policy_map.h" +#include "chrome/browser/policy/policy_bundle.h" namespace policy { typedef PolicyServiceImpl::Providers::const_iterator Iterator; -PolicyServiceImpl::PolicyServiceImpl(const Providers& providers) - : update_task_ptr_factory_(this) { +PolicyServiceImpl::PolicyServiceImpl( + const Providers& providers, + const PreprocessCallback& preprocess_callback) + : preprocess_callback_(preprocess_callback), + update_task_ptr_factory_(this) { for (int domain = 0; domain < POLICY_DOMAIN_SIZE; ++domain) initialization_complete_[domain] = true; providers_ = providers; @@ -127,8 +130,13 @@ void PolicyServiceImpl::NotifyNamespaceUpdated( void PolicyServiceImpl::MergeAndTriggerUpdates() { // Merge from each provider in their order of priority. PolicyBundle bundle; - for (Iterator it = providers_.begin(); it != providers_.end(); ++it) - bundle.MergeFrom((*it)->policies()); + for (Iterator it = providers_.begin(); it != providers_.end(); ++it) { + PolicyBundle provided_bundle; + provided_bundle.CopyFrom((*it)->policies()); + if (!preprocess_callback_.is_null()) + preprocess_callback_.Run(&provided_bundle); + bundle.MergeFrom(provided_bundle); + } // Swap first, so that observers that call GetPolicies() see the current // values. |