Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_ |
| 6 #define CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_ | 6 #define CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "chrome/browser/chromeos/login/signed_settings.h" | 10 #include "chrome/browser/chromeos/login/signed_settings.h" |
| 11 #include "chrome/browser/chromeos/login/signed_settings_helper.h" | 11 #include "chrome/browser/chromeos/login/signed_settings_helper.h" |
|
Mattias Nissler (ping if slow)
2011/11/30 12:25:50
Drop these includes and forward-declare SignedSett
pastarmovj
2011/11/30 17:21:16
Done.
| |
| 12 #include "chrome/browser/policy/cloud_policy_cache_base.h" | 12 #include "chrome/browser/policy/cloud_policy_cache_base.h" |
| 13 #include "chrome/browser/policy/proto/chrome_device_policy.pb.h" | 13 #include "chrome/browser/policy/proto/chrome_device_policy.pb.h" |
| 14 | 14 |
| 15 namespace policy { | 15 namespace policy { |
| 16 | 16 |
| 17 class CloudPolicyDataStore; | 17 class CloudPolicyDataStore; |
| 18 class EnterpriseInstallAttributes; | 18 class EnterpriseInstallAttributes; |
| 19 class PolicyMap; | 19 class PolicyMap; |
| 20 | 20 |
| 21 namespace em = enterprise_management; | 21 namespace em = enterprise_management; |
| 22 | 22 |
| 23 // CloudPolicyCacheBase implementation that persists policy information | 23 // CloudPolicyCacheBase implementation that persists policy information |
| 24 // to ChromeOS' session manager (via SignedSettingsHelper). | 24 // to ChromeOS' session manager (via SignedSettingsHelper). |
| 25 class DevicePolicyCache : public CloudPolicyCacheBase, | 25 class DevicePolicyCache : public CloudPolicyCacheBase { |
| 26 public chromeos::SignedSettingsHelper::Callback { | |
| 27 public: | 26 public: |
| 28 DevicePolicyCache(CloudPolicyDataStore* data_store, | 27 DevicePolicyCache(CloudPolicyDataStore* data_store, |
| 29 EnterpriseInstallAttributes* install_attributes); | 28 EnterpriseInstallAttributes* install_attributes); |
| 30 virtual ~DevicePolicyCache(); | 29 virtual ~DevicePolicyCache(); |
| 31 | 30 |
| 32 // CloudPolicyCacheBase implementation: | 31 // CloudPolicyCacheBase implementation: |
| 33 virtual void Load() OVERRIDE; | 32 virtual void Load() OVERRIDE; |
| 34 virtual void SetPolicy(const em::PolicyFetchResponse& policy) OVERRIDE; | 33 virtual void SetPolicy(const em::PolicyFetchResponse& policy) OVERRIDE; |
| 35 virtual void SetUnmanaged() OVERRIDE; | 34 virtual void SetUnmanaged() OVERRIDE; |
| 36 | 35 |
| 37 // SignedSettingsHelper::Callback implementation: | 36 void OnRetrievePolicyCompleted( |
| 38 virtual void OnRetrievePolicyCompleted( | |
| 39 chromeos::SignedSettings::ReturnCode code, | 37 chromeos::SignedSettings::ReturnCode code, |
| 40 const em::PolicyFetchResponse& policy) OVERRIDE; | 38 const em::PolicyFetchResponse& policy) OVERRIDE; |
|
Mattias Nissler (ping if slow)
2011/11/30 12:25:50
this is no longer an override.
pastarmovj
2011/11/30 17:21:16
Yeah clang already told me so :)
| |
| 41 | 39 |
| 42 private: | 40 private: |
| 43 friend class DevicePolicyCacheTest; | 41 friend class DevicePolicyCacheTest; |
| 44 friend class DevicePolicyCacheTestHelper; | 42 friend class DevicePolicyCacheTestHelper; |
| 45 | 43 |
| 46 // Alternate c'tor allowing tests to mock out the SignedSettingsHelper | 44 // Alternate c'tor allowing tests to mock out the SignedSettingsHelper |
| 47 // singleton. | 45 // singleton. |
| 48 DevicePolicyCache( | 46 DevicePolicyCache( |
| 49 CloudPolicyDataStore* data_store, | 47 CloudPolicyDataStore* data_store, |
| 50 EnterpriseInstallAttributes* install_attributes, | 48 EnterpriseInstallAttributes* install_attributes, |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 77 chromeos::SignedSettingsHelper* signed_settings_helper_; | 75 chromeos::SignedSettingsHelper* signed_settings_helper_; |
| 78 | 76 |
| 79 base::WeakPtrFactory<DevicePolicyCache> weak_ptr_factory_; | 77 base::WeakPtrFactory<DevicePolicyCache> weak_ptr_factory_; |
| 80 | 78 |
| 81 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCache); | 79 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCache); |
| 82 }; | 80 }; |
| 83 | 81 |
| 84 } // namespace policy | 82 } // namespace policy |
| 85 | 83 |
| 86 #endif // CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_ | 84 #endif // CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_ |
| OLD | NEW |