Index: chrome/browser/policy/async_policy_loader.cc |
diff --git a/chrome/browser/policy/async_policy_loader.cc b/chrome/browser/policy/async_policy_loader.cc |
index 13e23e2d19b96b30e83fb08f2828cf5ef133c891..7919e3c3ce19e6883a8372f2cc7d47f3a77970c9 100644 |
--- a/chrome/browser/policy/async_policy_loader.cc |
+++ b/chrome/browser/policy/async_policy_loader.cc |
@@ -6,6 +6,7 @@ |
#include "base/bind.h" |
#include "chrome/browser/policy/policy_bundle.h" |
+#include "chrome/browser/policy/policy_domain_descriptor.h" |
#include "content/public/browser/browser_thread.h" |
using base::Time; |
@@ -55,10 +56,24 @@ void AsyncPolicyLoader::Reload(bool force) { |
return; |
} |
+ // Filter out mismatching policies. |
+ for (DescriptorMap::iterator it = descriptor_map_.begin(); |
+ it != descriptor_map_.end(); ++it) { |
+ it->second->FilterBundle(bundle.get()); |
+ } |
+ |
update_callback_.Run(bundle.Pass()); |
ScheduleNextReload(TimeDelta::FromSeconds(kReloadIntervalSeconds)); |
} |
+void AsyncPolicyLoader::RegisterPolicyDomain( |
+ scoped_refptr<const PolicyDomainDescriptor> descriptor) { |
+ if (descriptor->domain() != POLICY_DOMAIN_CHROME) { |
+ descriptor_map_[descriptor->domain()] = descriptor; |
+ Reload(true); |
+ } |
+} |
+ |
scoped_ptr<PolicyBundle> AsyncPolicyLoader::InitialLoad() { |
// This is the first load, early during startup. Use this to record the |
// initial |last_modification_time_|, so that potential changes made before |