| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 9 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 10 #include "chrome/browser/policy/cloud_policy_cache_base.h" | 10 #include "chrome/browser/policy/cloud_policy_cache_base.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // Ensures that CrosSettings has established trust on the reporting prefs and | 68 // Ensures that CrosSettings has established trust on the reporting prefs and |
| 69 // publishes the |device_token| loaded from the cache. It's important that we | 69 // publishes the |device_token| loaded from the cache. It's important that we |
| 70 // have fully-initialized device settings s.t. device status uploads get the | 70 // have fully-initialized device settings s.t. device status uploads get the |
| 71 // correct reporting policy flags. | 71 // correct reporting policy flags. |
| 72 void SetTokenAndFlagReady(const std::string& device_token); | 72 void SetTokenAndFlagReady(const std::string& device_token); |
| 73 | 73 |
| 74 // Checks whether a policy fetch is pending and sends out a notification if | 74 // Checks whether a policy fetch is pending and sends out a notification if |
| 75 // that is the case. | 75 // that is the case. |
| 76 void CheckFetchingDone(); | 76 void CheckFetchingDone(); |
| 77 | 77 |
| 78 void DecodeDevicePolicy( | |
| 79 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
| 80 PolicyMap* policies); | |
| 81 | |
| 82 // Decode the various groups of policies. | |
| 83 static void DecodeLoginPolicies( | |
| 84 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
| 85 PolicyMap* policies); | |
| 86 static void DecodeKioskPolicies( | |
| 87 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
| 88 PolicyMap* policies, | |
| 89 EnterpriseInstallAttributes* install_attributes); | |
| 90 static void DecodeNetworkPolicies( | |
| 91 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
| 92 PolicyMap* policies, | |
| 93 EnterpriseInstallAttributes* install_attributes); | |
| 94 static void DecodeReportingPolicies( | |
| 95 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
| 96 PolicyMap* policies); | |
| 97 static void DecodeAutoUpdatePolicies( | |
| 98 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
| 99 PolicyMap* policies); | |
| 100 static void DecodeGenericPolicies( | |
| 101 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
| 102 PolicyMap* policies); | |
| 103 | |
| 104 CloudPolicyDataStore* data_store_; | 78 CloudPolicyDataStore* data_store_; |
| 105 EnterpriseInstallAttributes* install_attributes_; | 79 EnterpriseInstallAttributes* install_attributes_; |
| 106 | 80 |
| 107 chromeos::DeviceSettingsService* device_settings_service_; | 81 chromeos::DeviceSettingsService* device_settings_service_; |
| 108 | 82 |
| 109 base::WeakPtrFactory<DevicePolicyCache> weak_ptr_factory_; | 83 base::WeakPtrFactory<DevicePolicyCache> weak_ptr_factory_; |
| 110 | 84 |
| 111 bool policy_fetch_pending_; | 85 bool policy_fetch_pending_; |
| 112 | 86 |
| 113 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCache); | 87 DISALLOW_COPY_AND_ASSIGN(DevicePolicyCache); |
| 114 }; | 88 }; |
| 115 | 89 |
| 116 } // namespace policy | 90 } // namespace policy |
| 117 | 91 |
| 118 #endif // CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_ | 92 #endif // CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_ |
| OLD | NEW |