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

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

Issue 6312121: Add initial device policy infrastructure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix race condition and tests. 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/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..af0d19a78bbfe0b2c16277c64b85e8ea523be6c2
--- /dev/null
+++ b/chrome/browser/policy/cloud_policy_context.h
@@ -0,0 +1,71 @@
+// 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
+// cycle of the policy providers.
+class CloudPolicyContext : public NotificationObserver {
+ public:
+ CloudPolicyContext(const FilePath& policy_cache_file,
+ CloudPolicyController* controller_);
+ virtual ~CloudPolicyContext();
+
+ // Initializes the context.
+ void Initialize(PrefService* prefs,
+ const char* refresh_rate_pref_name,
+ URLRequestContextGetter* request_context);
+
+ // Shuts the context down. This must be called before threading and network
+ // infrastructure goes away.
+ void Shutdown();
+
+ ConfigurationPolicyProvider* GetManagedPolicyProvider();
+ ConfigurationPolicyProvider* GetRecommendedPolicyProvider();
+
+ 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_
« no previous file with comments | « chrome/browser/policy/cloud_policy_client_unittest.cc ('k') | chrome/browser/policy/cloud_policy_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698