Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1782)

Unified Diff: chrome/browser/policy/async_policy_loader.cc

Issue 15061007: Added a PolicyDomainDescriptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/async_policy_loader.h ('k') | chrome/browser/policy/async_policy_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/policy/async_policy_loader.h ('k') | chrome/browser/policy/async_policy_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698