| 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 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 switch (status) { | 202 switch (status) { |
| 203 case chromeos::DeviceSettingsService::STORE_SUCCESS: { | 203 case chromeos::DeviceSettingsService::STORE_SUCCESS: { |
| 204 status_ = STATUS_OK; | 204 status_ = STATUS_OK; |
| 205 policy_.reset(new em::PolicyData()); | 205 policy_.reset(new em::PolicyData()); |
| 206 if (policy_data) | 206 if (policy_data) |
| 207 policy_->MergeFrom(*policy_data); | 207 policy_->MergeFrom(*policy_data); |
| 208 | 208 |
| 209 PolicyMap new_policy_map; | 209 PolicyMap new_policy_map; |
| 210 if (is_enterprise_managed && is_managed()) { | 210 if (is_enterprise_managed && is_managed()) { |
| 211 DecodeDevicePolicy(*device_settings_service_->device_settings(), | 211 DecodeDevicePolicy(*device_settings_service_->device_settings(), |
| 212 &new_policy_map, install_attributes_); | 212 &new_policy_map); |
| 213 } | 213 } |
| 214 policy_map_.Swap(&new_policy_map); | 214 policy_map_.Swap(&new_policy_map); |
| 215 | 215 |
| 216 NotifyStoreLoaded(); | 216 NotifyStoreLoaded(); |
| 217 return; | 217 return; |
| 218 } | 218 } |
| 219 case chromeos::DeviceSettingsService::STORE_KEY_UNAVAILABLE: | 219 case chromeos::DeviceSettingsService::STORE_KEY_UNAVAILABLE: |
| 220 status_ = STATUS_BAD_STATE; | 220 status_ = STATUS_BAD_STATE; |
| 221 break; | 221 break; |
| 222 case chromeos::DeviceSettingsService::STORE_POLICY_ERROR: | 222 case chromeos::DeviceSettingsService::STORE_POLICY_ERROR: |
| 223 case chromeos::DeviceSettingsService::STORE_OPERATION_FAILED: | 223 case chromeos::DeviceSettingsService::STORE_OPERATION_FAILED: |
| 224 status_ = STATUS_STORE_ERROR; | 224 status_ = STATUS_STORE_ERROR; |
| 225 break; | 225 break; |
| 226 case chromeos::DeviceSettingsService::STORE_NO_POLICY: | 226 case chromeos::DeviceSettingsService::STORE_NO_POLICY: |
| 227 case chromeos::DeviceSettingsService::STORE_INVALID_POLICY: | 227 case chromeos::DeviceSettingsService::STORE_INVALID_POLICY: |
| 228 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: | 228 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: |
| 229 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: | 229 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: |
| 230 status_ = STATUS_LOAD_ERROR; | 230 status_ = STATUS_LOAD_ERROR; |
| 231 break; | 231 break; |
| 232 } | 232 } |
| 233 | 233 |
| 234 NotifyStoreError(); | 234 NotifyStoreError(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace policy | 237 } // namespace policy |
| OLD | NEW |