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_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // Populates in-memory cache from the local_state cache that is used to store | 62 // Populates in-memory cache from the local_state cache that is used to store |
63 // device settings before the device is owned and to speed up policy | 63 // device settings before the device is owned and to speed up policy |
64 // availability before the policy blob is fetched on boot. | 64 // availability before the policy blob is fetched on boot. |
65 void RetrieveCachedData(); | 65 void RetrieveCachedData(); |
66 | 66 |
67 // Stores a value from the |pending_changes_| queue in the device settings. | 67 // Stores a value from the |pending_changes_| queue in the device settings. |
68 // If the device is not owned yet the data ends up only in the local_state | 68 // If the device is not owned yet the data ends up only in the local_state |
69 // cache and is serialized once ownership is acquired. | 69 // cache and is serialized once ownership is acquired. |
70 void SetInPolicy(); | 70 void SetInPolicy(); |
71 | 71 |
72 // Decode the various groups of policies. | |
73 void DecodeLoginPolicies( | |
74 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
75 PrefValueMap* new_values_cache) const; | |
76 void DecodeKioskPolicies( | |
77 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
78 PrefValueMap* new_values_cache) const; | |
79 void DecodeNetworkPolicies( | |
80 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
81 PrefValueMap* new_values_cache) const; | |
82 void DecodeAutoUpdatePolicies( | |
83 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
84 PrefValueMap* new_values_cache) const; | |
85 void DecodeReportingPolicies( | |
86 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
87 PrefValueMap* new_values_cache) const; | |
88 void DecodeGenericPolicies( | |
89 const enterprise_management::ChromeDeviceSettingsProto& policy, | |
90 PrefValueMap* new_values_cache) const; | |
91 | |
92 // Parses the policy data and fills in |values_cache_|. | 72 // Parses the policy data and fills in |values_cache_|. |
93 void UpdateValuesCache( | 73 void UpdateValuesCache( |
94 const enterprise_management::PolicyData& policy_data, | 74 const enterprise_management::PolicyData& policy_data, |
95 const enterprise_management::ChromeDeviceSettingsProto& settings, | 75 const enterprise_management::ChromeDeviceSettingsProto& settings, |
96 TrustedStatus trusted_status); | 76 TrustedStatus trusted_status); |
97 | 77 |
98 // Applies the metrics policy and if not set migrates the legacy file. | 78 // Applies the metrics policy and if not set migrates the legacy file. |
99 void ApplyMetricsSetting(bool use_file, bool new_value); | 79 void ApplyMetricsSetting(bool use_file, bool new_value); |
100 | 80 |
101 // Applies the data roaming policy. | 81 // Applies the data roaming policy. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 InitializationTestUnowned); | 149 InitializationTestUnowned); |
170 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, | 150 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, |
171 PolicyFailedPermanentlyNotification); | 151 PolicyFailedPermanentlyNotification); |
172 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, PolicyLoadNotification); | 152 FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, PolicyLoadNotification); |
173 DISALLOW_COPY_AND_ASSIGN(DeviceSettingsProvider); | 153 DISALLOW_COPY_AND_ASSIGN(DeviceSettingsProvider); |
174 }; | 154 }; |
175 | 155 |
176 } // namespace chromeos | 156 } // namespace chromeos |
177 | 157 |
178 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ | 158 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_PROVIDER_H_ |
OLD | NEW |