| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 if (policy_data) | 157 if (policy_data) |
| 158 policy_->MergeFrom(*policy_data); | 158 policy_->MergeFrom(*policy_data); |
| 159 | 159 |
| 160 PolicyMap new_policy_map; | 160 PolicyMap new_policy_map; |
| 161 if (is_managed()) { | 161 if (is_managed()) { |
| 162 DecodeDevicePolicy(*device_settings_service_->device_settings(), | 162 DecodeDevicePolicy(*device_settings_service_->device_settings(), |
| 163 &new_policy_map); | 163 &new_policy_map); |
| 164 } | 164 } |
| 165 policy_map_.Swap(&new_policy_map); | 165 policy_map_.Swap(&new_policy_map); |
| 166 | 166 |
| 167 scoped_refptr<ownership::PublicKey> key = |
| 168 device_settings_service_->GetPublicKey(); |
| 169 policy_signature_public_key_ = key ? key->as_string() : std::string(); |
| 170 |
| 167 NotifyStoreLoaded(); | 171 NotifyStoreLoaded(); |
| 168 return; | 172 return; |
| 169 } | 173 } |
| 170 NotifyStoreError(); | 174 NotifyStoreError(); |
| 171 } | 175 } |
| 172 | 176 |
| 173 void DeviceCloudPolicyStoreChromeOS::UpdateStatusFromService() { | 177 void DeviceCloudPolicyStoreChromeOS::UpdateStatusFromService() { |
| 174 switch (device_settings_service_->status()) { | 178 switch (device_settings_service_->status()) { |
| 175 case chromeos::DeviceSettingsService::STORE_SUCCESS: | 179 case chromeos::DeviceSettingsService::STORE_SUCCESS: |
| 176 status_ = STATUS_OK; | 180 status_ = STATUS_OK; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 UMA_HISTOGRAM_BOOLEAN(kDMTokenCheckHistogram, true); | 234 UMA_HISTOGRAM_BOOLEAN(kDMTokenCheckHistogram, true); |
| 231 } else { | 235 } else { |
| 232 LOG(ERROR) << "Device policy read on enrolled device yields " | 236 LOG(ERROR) << "Device policy read on enrolled device yields " |
| 233 << "no DM token! Status: " << service_status << "."; | 237 << "no DM token! Status: " << service_status << "."; |
| 234 chromeos::StartupUtils::MarkEnrollmentRecoveryRequired(); | 238 chromeos::StartupUtils::MarkEnrollmentRecoveryRequired(); |
| 235 UMA_HISTOGRAM_BOOLEAN(kDMTokenCheckHistogram, false); | 239 UMA_HISTOGRAM_BOOLEAN(kDMTokenCheckHistogram, false); |
| 236 } | 240 } |
| 237 } | 241 } |
| 238 | 242 |
| 239 } // namespace policy | 243 } // namespace policy |
| OLD | NEW |