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

Unified Diff: chrome/browser/policy/policy_service_impl.h

Issue 10236003: Added RefreshPolicies to PolicyService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
Index: chrome/browser/policy/policy_service_impl.h
diff --git a/chrome/browser/policy/policy_service_impl.h b/chrome/browser/policy/policy_service_impl.h
index be6697551fd9f6cd007f0e871d745a60600809f6..18ee6d7feeec8e54db4815aa6a72d67208376169 100644
--- a/chrome/browser/policy/policy_service_impl.h
+++ b/chrome/browser/policy/policy_service_impl.h
@@ -41,6 +41,7 @@ class PolicyServiceImpl : public PolicyService,
PolicyDomain domain,
const std::string& component_id) const OVERRIDE;
virtual bool IsInitializationComplete() const OVERRIDE;
+ virtual void RefreshPolicies(const base::Closure& callback) OVERRIDE;
private:
struct Entry;
@@ -63,7 +64,9 @@ class PolicyServiceImpl : public PolicyService,
// Combines the policies from all the providers, and notifies the observers
// of namespaces whose policies have been modified.
- void MergeAndTriggerUpdates();
+ // |is_refresh| should be true if MergeAndTriggerUpdates() was invoked because
+ // a provider has just refreshed its policies.
+ void MergeAndTriggerUpdates(bool is_refresh);
// Contains all the providers together with a cached copy of their policies
// and their registrars.
@@ -75,6 +78,10 @@ class PolicyServiceImpl : public PolicyService,
// True if all the providers are initialized.
bool initialization_complete_;
+ // List of callbacks to invoke once all providers refresh after a
+ // RefreshPolicies() call.
+ std::vector<base::Closure> refresh_callbacks_;
+
DISALLOW_COPY_AND_ASSIGN(PolicyServiceImpl);
};

Powered by Google App Engine
This is Rietveld 408576698