| 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/gtest_prod_util.h" |
| 9 #include "base/memory/scoped_callback_factory.h" | 10 #include "base/memory/scoped_callback_factory.h" |
| 10 #include "chrome/browser/chromeos/login/signed_settings.h" | 11 #include "chrome/browser/chromeos/login/signed_settings.h" |
| 11 #include "chrome/browser/chromeos/login/signed_settings_helper.h" | 12 #include "chrome/browser/chromeos/login/signed_settings_helper.h" |
| 12 #include "chrome/browser/policy/cloud_policy_cache_base.h" | 13 #include "chrome/browser/policy/cloud_policy_cache_base.h" |
| 13 #include "chrome/browser/policy/proto/chrome_device_policy.pb.h" | 14 #include "chrome/browser/policy/proto/chrome_device_policy.pb.h" |
| 14 | 15 |
| 15 namespace policy { | 16 namespace policy { |
| 16 | 17 |
| 17 class CloudPolicyDataStore; | 18 class CloudPolicyDataStore; |
| 18 class EnterpriseInstallAttributes; | 19 class EnterpriseInstallAttributes; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 35 virtual void SetUnmanaged() OVERRIDE; | 36 virtual void SetUnmanaged() OVERRIDE; |
| 36 virtual bool IsReady() OVERRIDE; | 37 virtual bool IsReady() OVERRIDE; |
| 37 | 38 |
| 38 // SignedSettingsHelper::Callback implementation: | 39 // SignedSettingsHelper::Callback implementation: |
| 39 virtual void OnRetrievePolicyCompleted( | 40 virtual void OnRetrievePolicyCompleted( |
| 40 chromeos::SignedSettings::ReturnCode code, | 41 chromeos::SignedSettings::ReturnCode code, |
| 41 const em::PolicyFetchResponse& policy) OVERRIDE; | 42 const em::PolicyFetchResponse& policy) OVERRIDE; |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 friend class DevicePolicyCacheTest; | 45 friend class DevicePolicyCacheTest; |
| 46 FRIEND_TEST_ALL_PREFIXES(EnterpriseMetricsTest, DevicePolicyStorage); |
| 45 | 47 |
| 46 // Alternate c'tor allowing tests to mock out the SignedSettingsHelper | 48 // Alternate c'tor allowing tests to mock out the SignedSettingsHelper |
| 47 // singleton. | 49 // singleton. |
| 48 DevicePolicyCache( | 50 DevicePolicyCache( |
| 49 CloudPolicyDataStore* data_store, | 51 CloudPolicyDataStore* data_store, |
| 50 EnterpriseInstallAttributes* install_attributes, | 52 EnterpriseInstallAttributes* install_attributes, |
| 51 chromeos::SignedSettingsHelper* signed_settings_helper); | 53 chromeos::SignedSettingsHelper* signed_settings_helper); |
| 52 | 54 |
| 53 // CloudPolicyCacheBase implementation: | 55 // CloudPolicyCacheBase implementation: |
| 54 virtual bool DecodePolicyData(const em::PolicyData& policy_data, | 56 virtual bool DecodePolicyData(const em::PolicyData& policy_data, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 73 bool starting_up_; | 75 bool starting_up_; |
| 74 | 76 |
| 75 base::ScopedCallbackFactory<DevicePolicyCache> callback_factory_; | 77 base::ScopedCallbackFactory<DevicePolicyCache> callback_factory_; |
| 76 | 78 |
| 77 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCache); | 79 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCache); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 } // namespace policy | 82 } // namespace policy |
| 81 | 83 |
| 82 #endif // CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_ | 84 #endif // CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_ |
| OLD | NEW |