| 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_
|
|
|