Index: chrome/browser/policy/cloud_policy_context.h |
diff --git a/chrome/browser/policy/cloud_policy_context.h b/chrome/browser/policy/cloud_policy_context.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b131f8f52afd08f810b5d5d90998715c14684cbe |
--- /dev/null |
+++ b/chrome/browser/policy/cloud_policy_context.h |
@@ -0,0 +1,74 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTEXT_H_ |
+#define CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTEXT_H_ |
+#pragma once |
+ |
+#include "base/scoped_ptr.h" |
+#include "chrome/browser/prefs/pref_member.h" |
+#include "chrome/common/notification_observer.h" |
+ |
+class FilePath; |
+class PrefService; |
+class URLRequestContextGetter; |
+ |
+namespace policy { |
+ |
+class CloudPolicyCache; |
+class CloudPolicyClient; |
+class CloudPolicyController; |
+class ConfigurationPolicyProvider; |
+class DeviceManagementService; |
+class DeviceTokenFetcher; |
+ |
+// This class is a container for the infrastructure required to support cloud |
+// policy. It glues together the backend, the policy client and manages the live |
Jakob Kummerow
2011/02/07 16:00:09
nit: s/live/life/
Jakob Kummerow
2011/02/14 13:50:34
Done.
|
+// cycle of the policy providers. |
+class CloudPolicyContext : public NotificationObserver { |
danno
2011/02/04 16:01:33
CloudPolicyCustodian
Jakob Kummerow
2011/02/14 13:50:34
Done -- CloudPolicySubsystem.
|
+ public: |
+ CloudPolicyContext(const FilePath& policy_cache_file, |
+ CloudPolicyController* controller_); |
+ virtual ~CloudPolicyContext(); |
+ |
+ // Initializes the context. |
+ void Initialize(PrefService* prefs, URLRequestContextGetter* request_context); |
+ |
+ // Shuts the context down. This must be called before threading and network |
+ // infrastructure goes away. |
+ void Shutdown(); |
+ |
+ ConfigurationPolicyProvider* GetManagedPolicyProvider(); |
+ ConfigurationPolicyProvider* GetRecommendedPolicyProvider(); |
+ |
+ static void RegisterPrefs(PrefService* user_prefs); |
+ |
+ static const int kDefaultPolicyRefreshRateInMilliseconds = |
+ 3 * 60 * 60 * 1000; // 3 hours. |
Jakob Kummerow
2011/02/07 16:00:09
nit: two spaces before comment
Jakob Kummerow
2011/02/14 13:50:34
Done.
|
+ |
+ 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 pref service that controls the refresh rate. |
+ PrefService* prefs_; |
+ |
+ // Tracks the pref value for the policy refresh rate. |
+ IntegerPrefMember policy_refresh_rate_; |
+ |
+ // Cloud policy infrastructure stuff. |
+ scoped_ptr<DeviceManagementService> device_management_service_; |
+ scoped_ptr<DeviceTokenFetcher> device_token_fetcher_; |
+ scoped_ptr<CloudPolicyCache> cloud_policy_cache_; |
+ scoped_ptr<CloudPolicyClient> cloud_policy_client_; |
+}; |
+ |
+} // namespace policy |
+ |
+#endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTEXT_H_ |