Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc

Issue 2488573003: Expose signing key from cloud policy stores (Closed)
Patch Set: Fix tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 if (policy_data) 191 if (policy_data)
192 policy_->MergeFrom(*policy_data); 192 policy_->MergeFrom(*policy_data);
193 193
194 PolicyMap new_policy_map; 194 PolicyMap new_policy_map;
195 if (is_managed()) { 195 if (is_managed()) {
196 DecodeDevicePolicy(*device_settings_service_->device_settings(), 196 DecodeDevicePolicy(*device_settings_service_->device_settings(),
197 &new_policy_map); 197 &new_policy_map);
198 } 198 }
199 policy_map_.Swap(&new_policy_map); 199 policy_map_.Swap(&new_policy_map);
200 200
201 DCHECK(owning_domain_.empty() ||
202 owning_domain_ == install_attributes_->GetDomain());
203 owning_domain_ = install_attributes_->GetDomain();
204
205 scoped_refptr<ownership::PublicKey> key =
206 device_settings_service_->GetPublicKey();
207 public_key_ = key ? key->as_string() : std::string();
208
201 NotifyStoreLoaded(); 209 NotifyStoreLoaded();
202 return; 210 return;
203 } 211 }
204 case chromeos::DeviceSettingsService::STORE_KEY_UNAVAILABLE: 212 case chromeos::DeviceSettingsService::STORE_KEY_UNAVAILABLE:
205 status_ = STATUS_BAD_STATE; 213 status_ = STATUS_BAD_STATE;
206 break; 214 break;
207 case chromeos::DeviceSettingsService::STORE_POLICY_ERROR: 215 case chromeos::DeviceSettingsService::STORE_POLICY_ERROR:
208 case chromeos::DeviceSettingsService::STORE_OPERATION_FAILED: 216 case chromeos::DeviceSettingsService::STORE_OPERATION_FAILED:
209 status_ = STATUS_STORE_ERROR; 217 status_ = STATUS_STORE_ERROR;
210 break; 218 break;
211 case chromeos::DeviceSettingsService::STORE_NO_POLICY: 219 case chromeos::DeviceSettingsService::STORE_NO_POLICY:
212 case chromeos::DeviceSettingsService::STORE_INVALID_POLICY: 220 case chromeos::DeviceSettingsService::STORE_INVALID_POLICY:
213 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: 221 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR:
214 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: 222 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR:
215 status_ = STATUS_LOAD_ERROR; 223 status_ = STATUS_LOAD_ERROR;
216 break; 224 break;
217 } 225 }
218 226
219 NotifyStoreError(); 227 NotifyStoreError();
220 } 228 }
221 229
222 } // namespace policy 230 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698