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

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

Issue 6310012: Allow policy refresh rate to be configured through policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test. Created 9 years, 11 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/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_;
« no previous file with comments | « chrome/browser/policy/device_token_fetcher_unittest.cc ('k') | chrome/browser/policy/profile_policy_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698