Chromium Code Reviews| 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_CLOUD_POLICY_CONTEXT_H_ | |
| 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTEXT_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/scoped_ptr.h" | |
| 10 #include "chrome/browser/prefs/pref_member.h" | |
| 11 #include "chrome/common/notification_observer.h" | |
| 12 | |
| 13 class FilePath; | |
| 14 class PrefService; | |
| 15 class URLRequestContextGetter; | |
| 16 | |
| 17 namespace policy { | |
| 18 | |
| 19 class CloudPolicyCache; | |
| 20 class CloudPolicyClient; | |
| 21 class CloudPolicyController; | |
| 22 class ConfigurationPolicyProvider; | |
| 23 class DeviceManagementService; | |
| 24 class DeviceTokenFetcher; | |
| 25 | |
| 26 // This class is a container for the infrastructure required to support cloud | |
| 27 // policy. It glues together the backend, the policy client and manages the live | |
|
Jakob Kummerow
2011/02/07 16:00:09
nit: s/live/life/
Jakob Kummerow
2011/02/14 13:50:34
Done.
| |
| 28 // cycle of the policy providers. | |
| 29 class CloudPolicyContext : public NotificationObserver { | |
|
danno
2011/02/04 16:01:33
CloudPolicyCustodian
Jakob Kummerow
2011/02/14 13:50:34
Done -- CloudPolicySubsystem.
| |
| 30 public: | |
| 31 CloudPolicyContext(const FilePath& policy_cache_file, | |
| 32 CloudPolicyController* controller_); | |
| 33 virtual ~CloudPolicyContext(); | |
| 34 | |
| 35 // Initializes the context. | |
| 36 void Initialize(PrefService* prefs, URLRequestContextGetter* request_context); | |
| 37 | |
| 38 // Shuts the context down. This must be called before threading and network | |
| 39 // infrastructure goes away. | |
| 40 void Shutdown(); | |
| 41 | |
| 42 ConfigurationPolicyProvider* GetManagedPolicyProvider(); | |
| 43 ConfigurationPolicyProvider* GetRecommendedPolicyProvider(); | |
| 44 | |
| 45 static void RegisterPrefs(PrefService* user_prefs); | |
| 46 | |
| 47 static const int kDefaultPolicyRefreshRateInMilliseconds = | |
| 48 3 * 60 * 60 * 1000; // 3 hours. | |
|
Jakob Kummerow
2011/02/07 16:00:09
nit: two spaces before comment
Jakob Kummerow
2011/02/14 13:50:34
Done.
| |
| 49 | |
| 50 private: | |
| 51 // Updates the policy provider with a new refresh rate value. | |
| 52 void UpdatePolicyRefreshRate(); | |
| 53 | |
| 54 // NotificationObserver overrides. | |
| 55 virtual void Observe(NotificationType type, | |
| 56 const NotificationSource& source, | |
| 57 const NotificationDetails& details); | |
| 58 | |
| 59 // The pref service that controls the refresh rate. | |
| 60 PrefService* prefs_; | |
| 61 | |
| 62 // Tracks the pref value for the policy refresh rate. | |
| 63 IntegerPrefMember policy_refresh_rate_; | |
| 64 | |
| 65 // Cloud policy infrastructure stuff. | |
| 66 scoped_ptr<DeviceManagementService> device_management_service_; | |
| 67 scoped_ptr<DeviceTokenFetcher> device_token_fetcher_; | |
| 68 scoped_ptr<CloudPolicyCache> cloud_policy_cache_; | |
| 69 scoped_ptr<CloudPolicyClient> cloud_policy_client_; | |
| 70 }; | |
| 71 | |
| 72 } // namespace policy | |
| 73 | |
| 74 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTEXT_H_ | |
| OLD | NEW |