Index: chrome/browser/policy/profile_policy_context.h |
diff --git a/chrome/browser/policy/profile_policy_context.h b/chrome/browser/policy/profile_policy_context.h |
index b343e1566db1229589892d19e62acfd6a4445059..8650ec54dba262fe5aa6e94647fc1e777fa4ee05 100644 |
--- a/chrome/browser/policy/profile_policy_context.h |
+++ b/chrome/browser/policy/profile_policy_context.h |
@@ -7,6 +7,8 @@ |
#pragma once |
#include "base/scoped_ptr.h" |
+#include "chrome/browser/prefs/pref_member.h" |
+#include "chrome/common/notification_observer.h" |
class Profile; |
@@ -19,7 +21,7 @@ class DeviceManagementService; |
// profile. Since the context owns the policy provider, it's vital that it gets |
// initialized before the profile's prefs and destroyed after the prefs are |
// gone. |
-class ProfilePolicyContext { |
+class ProfilePolicyContext : public NotificationObserver { |
public: |
explicit ProfilePolicyContext(Profile* profile); |
~ProfilePolicyContext(); |
@@ -35,10 +37,27 @@ class ProfilePolicyContext { |
// Get the policy provider. |
DeviceManagementPolicyProvider* GetDeviceManagementPolicyProvider(); |
+ // Register preferences. |
+ static void RegisterUserPrefs(PrefService* user_prefs); |
+ |
+ static const int kDefaultPolicyRefreshRateInMilliseconds = |
+ 3 * 60 * 60 * 1000; // 3 hours. |
+ |
private: |
+ // Updates the policy provider with a new refresh rate value. |
+ void UpdatePolicyRefreshRate(); |
+ |
+ // NotificationObserver overrides. |
+ virtual void Observe(NotificationType type, |
+ const NotificationSource& source, |
+ const NotificationDetails& details); |
+ |
// The profile this context is associated with. |
Profile* profile_; |
+ // Tracks the pref value for the policy refresh rate. |
+ IntegerPrefMember policy_refresh_rate_; |
+ |
// The device management service. |
scoped_ptr<DeviceManagementService> device_management_service_; |