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

Unified Diff: chrome/browser/policy/browser_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
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/policy/browser_policy_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/browser_policy_context.h
diff --git a/chrome/browser/policy/browser_policy_context.h b/chrome/browser/policy/browser_policy_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..58f3eaf07e412e885655d46bd1ba15c434aba28b
--- /dev/null
+++ b/chrome/browser/policy/browser_policy_context.h
@@ -0,0 +1,64 @@
+// 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_BROWSER_POLICY_CONTEXT_H_
+#define CHROME_BROWSER_POLICY_BROWSER_POLICY_CONTEXT_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
+
+class PrefService;
+class TokenService;
+class URLRequestContextGetter;
+
+namespace policy {
+
+class CloudPolicyContext;
+class CloudPolicyController;
+class ConfigurationPolicyProvider;
+
+// Manages the lifecycle of browser-global policy infrastructure, such as the
+// platform policy providers.
+class BrowserPolicyContext {
+ public:
+ BrowserPolicyContext();
+ // Constructor for tests that allows tests to use fake platform policy
+ // providers instead of using the actual ones.
+ BrowserPolicyContext(
+ ConfigurationPolicyProvider* managed_platform_provider,
+ ConfigurationPolicyProvider* recommended_platform_provider);
+ ~BrowserPolicyContext();
+
+ // Activates the cloud policy context. We can't pass these in the constructor
+ // since the context must start up before threading and net is up.
+ void Initialize(PrefService* local_state,
+ URLRequestContextGetter* request_context);
+
+ ConfigurationPolicyProvider* GetManagedPlatformProvider() const;
+ ConfigurationPolicyProvider* GetManagedCloudProvider() const;
+ ConfigurationPolicyProvider* GetRecommendedPlatformProvider() const;
+ ConfigurationPolicyProvider* GetRecommendedCloudProvider() const;
+
+ static void RegisterPrefs(PrefService* user_prefs);
+
+ static const int kDefaultPolicyRefreshRateInMilliseconds =
+ 3 * 60 * 60 * 1000; // 3 hours.
+
+ private:
+ static ConfigurationPolicyProvider* CreateManagedPlatformProvider();
+ static ConfigurationPolicyProvider* CreateRecommendedPlatformProvider();
+
+ scoped_ptr<ConfigurationPolicyProvider> managed_platform_provider_;
+ scoped_ptr<ConfigurationPolicyProvider> recommended_platform_provider_;
+
+ scoped_ptr<CloudPolicyController> controller_;
+ scoped_ptr<CloudPolicyContext> cloud_context_;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowserPolicyContext);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONTEXT_H_
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/policy/browser_policy_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698