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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_SERVICE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 // Returns the status generated by the last operation. | 125 // Returns the status generated by the last operation. |
126 Status status() { | 126 Status status() { |
127 return store_status_; | 127 return store_status_; |
128 } | 128 } |
129 | 129 |
130 // Triggers an attempt to pull the public half of the owner key from disk and | 130 // Triggers an attempt to pull the public half of the owner key from disk and |
131 // load the device settings. | 131 // load the device settings. |
132 void Load(); | 132 void Load(); |
133 | 133 |
134 // Sets the management related settings in PolicyData. | |
135 // | |
136 // TODO (ygorshenin@, crbug.com/230018): move this to the | |
137 // OwnerSettingsService. | |
138 void SetManagementSettings( | |
139 enterprise_management::PolicyData::ManagementMode management_mode, | |
140 const std::string& request_token, | |
141 const std::string& device_id, | |
142 const base::Closure& callback); | |
143 | |
144 // Stores a policy blob to session_manager. The result of the operation is | 134 // Stores a policy blob to session_manager. The result of the operation is |
145 // reported through |callback|. If successful, the updated device settings are | 135 // reported through |callback|. If successful, the updated device settings are |
146 // present in policy_data() and device_settings() when the callback runs. | 136 // present in policy_data() and device_settings() when the callback runs. |
147 void Store(scoped_ptr<enterprise_management::PolicyFetchResponse> policy, | 137 void Store(scoped_ptr<enterprise_management::PolicyFetchResponse> policy, |
148 const base::Closure& callback); | 138 const base::Closure& callback); |
149 | 139 |
150 // Returns the ownership status. May return OWNERSHIP_UNKNOWN if the disk | 140 // Returns the ownership status. May return OWNERSHIP_UNKNOWN if the disk |
151 // hasn't been checked yet. | 141 // hasn't been checked yet. |
152 OwnershipStatus GetOwnershipStatus(); | 142 OwnershipStatus GetOwnershipStatus(); |
153 | 143 |
(...skipping 26 matching lines...) Expand all Loading... |
180 private: | 170 private: |
181 friend class OwnerSettingsServiceChromeOS; | 171 friend class OwnerSettingsServiceChromeOS; |
182 | 172 |
183 // Enqueues a new operation. Takes ownership of |operation| and starts it | 173 // Enqueues a new operation. Takes ownership of |operation| and starts it |
184 // right away if there is no active operation currently. | 174 // right away if there is no active operation currently. |
185 void Enqueue(const linked_ptr<SessionManagerOperation>& operation); | 175 void Enqueue(const linked_ptr<SessionManagerOperation>& operation); |
186 | 176 |
187 // Enqueues a load operation. | 177 // Enqueues a load operation. |
188 void EnqueueLoad(bool force_key_load); | 178 void EnqueueLoad(bool force_key_load); |
189 | 179 |
190 // Enqueues a sign and store operation. | |
191 // | |
192 // TODO (ygorshenin@, crbug.com/433840): extract SetManagementSettings() out | |
193 // of DeviceSettingsService and get rid of the method. | |
194 void EnqueueSignAndStore(scoped_ptr<enterprise_management::PolicyData> policy, | |
195 const base::Closure& callback); | |
196 | |
197 // Makes sure there's a reload operation so changes to the settings (and key, | 180 // Makes sure there's a reload operation so changes to the settings (and key, |
198 // in case force_key_load is set) are getting picked up. | 181 // in case force_key_load is set) are getting picked up. |
199 void EnsureReload(bool force_key_load); | 182 void EnsureReload(bool force_key_load); |
200 | 183 |
201 // Runs the next pending operation. | 184 // Runs the next pending operation. |
202 void StartNextOperation(); | 185 void StartNextOperation(); |
203 | 186 |
204 // Updates status, policy data and owner key from a finished operation. | 187 // Updates status, policy data and owner key from a finished operation. |
205 // Starts the next pending operation if available. | 188 // Starts the next pending operation if available. |
206 void HandleCompletedOperation(const base::Closure& callback, | 189 void HandleCompletedOperation(const base::Closure& callback, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 ScopedTestDeviceSettingsService(); | 228 ScopedTestDeviceSettingsService(); |
246 ~ScopedTestDeviceSettingsService(); | 229 ~ScopedTestDeviceSettingsService(); |
247 | 230 |
248 private: | 231 private: |
249 DISALLOW_COPY_AND_ASSIGN(ScopedTestDeviceSettingsService); | 232 DISALLOW_COPY_AND_ASSIGN(ScopedTestDeviceSettingsService); |
250 }; | 233 }; |
251 | 234 |
252 } // namespace chromeos | 235 } // namespace chromeos |
253 | 236 |
254 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_SERVICE_H_ | 237 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_SERVICE_H_ |
OLD | NEW |