OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | |
6 #define CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | |
7 #pragma once | |
8 | |
9 #include "base/basictypes.h" | |
10 #include "base/scoped_ptr.h" | |
11 | |
12 class PrefService; | |
13 class TestingBrowserProcess; | |
14 class TokenService; | |
15 class URLRequestContextGetter; | |
16 | |
17 namespace policy { | |
18 | |
19 class CloudPolicySubsystem; | |
20 class CloudPolicyIdentityStrategy; | |
Mattias Nissler (ping if slow)
2011/02/15 10:15:16
alphabetize
Jakob Kummerow
2011/02/21 12:12:15
Done.
| |
21 class ConfigurationPolicyProvider; | |
22 | |
23 // Manages the lifecycle of browser-global policy infrastructure, such as the | |
24 // platform policy providers. | |
25 class BrowserPolicyConnector { | |
26 public: | |
27 BrowserPolicyConnector(); | |
28 ~BrowserPolicyConnector(); | |
29 | |
30 // Activates the cloud policy context. We can't pass these in the constructor | |
gfeher
2011/02/14 17:28:50
context->connector?
Jakob Kummerow
2011/02/21 12:12:15
Done.
| |
31 // since the context must start up before threading and net is up. | |
danno
2011/02/15 12:27:15
context->connector here, too.
Jakob Kummerow
2011/02/21 12:12:15
Done.
| |
32 void Initialize(PrefService* local_state, | |
33 URLRequestContextGetter* request_context); | |
34 | |
35 ConfigurationPolicyProvider* GetManagedPlatformProvider() const; | |
36 ConfigurationPolicyProvider* GetManagedCloudProvider() const; | |
37 ConfigurationPolicyProvider* GetRecommendedPlatformProvider() const; | |
38 ConfigurationPolicyProvider* GetRecommendedCloudProvider() const; | |
39 | |
40 static void RegisterPrefs(PrefService* user_prefs); | |
41 | |
42 static const int kDefaultPolicyRefreshRateInMilliseconds = | |
43 3 * 60 * 60 * 1000; // 3 hours. | |
44 | |
45 private: | |
46 friend class ::TestingBrowserProcess; | |
47 | |
48 static ConfigurationPolicyProvider* CreateManagedPlatformProvider(); | |
49 static ConfigurationPolicyProvider* CreateRecommendedPlatformProvider(); | |
50 | |
51 // Constructor for tests that allows tests to use fake platform policy | |
52 // providers instead of using the actual ones. | |
53 BrowserPolicyConnector( | |
54 ConfigurationPolicyProvider* managed_platform_provider, | |
55 ConfigurationPolicyProvider* recommended_platform_provider); | |
56 | |
57 scoped_ptr<ConfigurationPolicyProvider> managed_platform_provider_; | |
58 scoped_ptr<ConfigurationPolicyProvider> recommended_platform_provider_; | |
59 | |
60 scoped_ptr<CloudPolicyIdentityStrategy> identity_strategy_; | |
61 scoped_ptr<CloudPolicySubsystem> cloud_policy_subsystem_; | |
62 | |
63 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); | |
64 }; | |
65 | |
66 } // namespace policy | |
67 | |
68 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | |
OLD | NEW |