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