summaryrefslogtreecommitdiffstats
path: root/chrome/browser/policy/browser_policy_connector.h
diff options
context:
space:
mode:
authorjkummerow@chromium.org <jkummerow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 09:54:25 +0000
committerjkummerow@chromium.org <jkummerow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 09:54:25 +0000
commit985655a307077dc9385fa4ed00bed3b8a64a805a (patch)
tree44b6ef8af1970224f900cf4da7fca9a35d414526 /chrome/browser/policy/browser_policy_connector.h
parentd63c6fc43c28f3153b3c6b758796e7d15c44bdd0 (diff)
downloadchromium_src-985655a307077dc9385fa4ed00bed3b8a64a805a.zip
chromium_src-985655a307077dc9385fa4ed00bed3b8a64a805a.tar.gz
chromium_src-985655a307077dc9385fa4ed00bed3b8a64a805a.tar.bz2
Device policy infrastructure
This continues the work of http://codereview.chromium.org/6312121/. Description of that CL: This refactors the cloud policy-related code to support device policy that gets associated with the whole browser session. Device policy information will show up in g_browser_process->local_state(). Also, start supporting recommended policy from the cloud. BUG=chromium-os:11259, chromium-os:11257, chromium-os:11256 TEST=Enable device policy by passing --device-policy-cache-dir, claim a device and verify that policy gets downloaded. Review URL: http://codereview.chromium.org/6520008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75732 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/policy/browser_policy_connector.h')
-rw-r--r--chrome/browser/policy/browser_policy_connector.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/chrome/browser/policy/browser_policy_connector.h b/chrome/browser/policy/browser_policy_connector.h
new file mode 100644
index 0000000..17e8c14
--- /dev/null
+++ b/chrome/browser/policy/browser_policy_connector.h
@@ -0,0 +1,77 @@
+// 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_CONNECTOR_H_
+#define CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
+#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
+
+class PrefService;
+class TestingBrowserProcess;
+class TokenService;
+class URLRequestContextGetter;
+
+namespace policy {
+
+class CloudPolicyIdentityStrategy;
+class CloudPolicySubsystem;
+class ConfigurationPolicyProvider;
+
+// Manages the lifecycle of browser-global policy infrastructure, such as the
+// platform policy providers.
+class BrowserPolicyConnector : public NotificationObserver {
+ public:
+ static const int kDefaultPolicyRefreshRateInMilliseconds =
+ 3 * 60 * 60 * 1000; // 3 hours.
+
+ BrowserPolicyConnector();
+ ~BrowserPolicyConnector();
+
+ ConfigurationPolicyProvider* GetManagedPlatformProvider() const;
+ ConfigurationPolicyProvider* GetManagedCloudProvider() const;
+ ConfigurationPolicyProvider* GetRecommendedPlatformProvider() const;
+ ConfigurationPolicyProvider* GetRecommendedCloudProvider() const;
+
+ static void RegisterPrefs(PrefService* user_prefs);
+
+ // NotificationObserver implementation:
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ private:
+ friend class ::TestingBrowserProcess;
+
+ static ConfigurationPolicyProvider* CreateManagedPlatformProvider();
+ static ConfigurationPolicyProvider* CreateRecommendedPlatformProvider();
+
+ // Constructor for tests that allows tests to use fake platform policy
+ // providers instead of using the actual ones.
+ BrowserPolicyConnector(
+ ConfigurationPolicyProvider* managed_platform_provider,
+ ConfigurationPolicyProvider* recommended_platform_provider);
+
+ // Activates the cloud policy subsystem. Called when the default request
+ // context is available.
+ void Initialize(PrefService* local_state,
+ URLRequestContextGetter* request_context);
+
+ scoped_ptr<ConfigurationPolicyProvider> managed_platform_provider_;
+ scoped_ptr<ConfigurationPolicyProvider> recommended_platform_provider_;
+
+ scoped_ptr<CloudPolicyIdentityStrategy> identity_strategy_;
+ scoped_ptr<CloudPolicySubsystem> cloud_policy_subsystem_;
+
+ NotificationRegistrar registrar_;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_