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

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: Simplify changes in DeviceLocalAccountPolicyStore 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 scoped_refptr<ownership::PublicKey> key =
202 device_settings_service_->GetPublicKey();
203 public_key_ = key ? key->as_string() : std::string();
Thiemo Nagel 2016/11/16 16:50:06 public_key_ doesn't seem to exist yet?
emaxx 2016/11/16 22:05:58 Nope, it's defined in the base class CloudPolicySt
Thiemo Nagel 2016/11/17 17:19:56 Sorry, I've overlooked that.
204
201 NotifyStoreLoaded(); 205 NotifyStoreLoaded();
202 return; 206 return;
203 } 207 }
204 case chromeos::DeviceSettingsService::STORE_KEY_UNAVAILABLE: 208 case chromeos::DeviceSettingsService::STORE_KEY_UNAVAILABLE:
205 status_ = STATUS_BAD_STATE; 209 status_ = STATUS_BAD_STATE;
206 break; 210 break;
207 case chromeos::DeviceSettingsService::STORE_POLICY_ERROR: 211 case chromeos::DeviceSettingsService::STORE_POLICY_ERROR:
208 case chromeos::DeviceSettingsService::STORE_OPERATION_FAILED: 212 case chromeos::DeviceSettingsService::STORE_OPERATION_FAILED:
209 status_ = STATUS_STORE_ERROR; 213 status_ = STATUS_STORE_ERROR;
210 break; 214 break;
211 case chromeos::DeviceSettingsService::STORE_NO_POLICY: 215 case chromeos::DeviceSettingsService::STORE_NO_POLICY:
212 case chromeos::DeviceSettingsService::STORE_INVALID_POLICY: 216 case chromeos::DeviceSettingsService::STORE_INVALID_POLICY:
213 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: 217 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR:
214 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: 218 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR:
215 status_ = STATUS_LOAD_ERROR; 219 status_ = STATUS_LOAD_ERROR;
216 break; 220 break;
217 } 221 }
218 222
219 NotifyStoreError(); 223 NotifyStoreError();
220 } 224 }
221 225
222 } // namespace policy 226 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698