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

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

Issue 23532034: Postpone loading about:flags ui until the certificates have been loaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 months 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 | Annotate | Revision Log
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_local_account_policy_store.h" 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_store.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/policy/cloud/device_management_service.h" 10 #include "chrome/browser/policy/cloud/device_management_service.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 device_settings_service_->GetOwnershipStatusAsync( 154 device_settings_service_->GetOwnershipStatusAsync(
155 base::Bind(&DeviceLocalAccountPolicyStore::Validate, 155 base::Bind(&DeviceLocalAccountPolicyStore::Validate,
156 weak_factory_.GetWeakPtr(), 156 weak_factory_.GetWeakPtr(),
157 base::Passed(&policy), 157 base::Passed(&policy),
158 callback)); 158 callback));
159 } 159 }
160 160
161 void DeviceLocalAccountPolicyStore::Validate( 161 void DeviceLocalAccountPolicyStore::Validate(
162 scoped_ptr<em::PolicyFetchResponse> policy_response, 162 scoped_ptr<em::PolicyFetchResponse> policy_response,
163 const UserCloudPolicyValidator::CompletionCallback& callback, 163 const UserCloudPolicyValidator::CompletionCallback& callback,
164 chromeos::DeviceSettingsService::OwnershipStatus ownership_status, 164 chromeos::DeviceSettingsService::OwnershipStatus ownership_status) {
165 bool is_owner) {
166 DCHECK_NE(chromeos::DeviceSettingsService::OWNERSHIP_UNKNOWN, 165 DCHECK_NE(chromeos::DeviceSettingsService::OWNERSHIP_UNKNOWN,
167 ownership_status); 166 ownership_status);
168 scoped_refptr<chromeos::OwnerKey> key = 167 scoped_refptr<chromeos::OwnerKey> key =
169 device_settings_service_->GetOwnerKey(); 168 device_settings_service_->GetOwnerKey();
170 if (!key.get() || !key->public_key()) { 169 if (!key.get() || !key->public_key()) {
171 status_ = CloudPolicyStore::STATUS_BAD_STATE; 170 status_ = CloudPolicyStore::STATUS_BAD_STATE;
172 NotifyStoreLoaded(); 171 NotifyStoreLoaded();
173 return; 172 return;
174 } 173 }
175 174
176 scoped_ptr<UserCloudPolicyValidator> validator( 175 scoped_ptr<UserCloudPolicyValidator> validator(
177 UserCloudPolicyValidator::Create(policy_response.Pass())); 176 UserCloudPolicyValidator::Create(policy_response.Pass()));
178 validator->ValidateUsername(account_id_); 177 validator->ValidateUsername(account_id_);
179 validator->ValidatePolicyType(dm_protocol::kChromePublicAccountPolicyType); 178 validator->ValidatePolicyType(dm_protocol::kChromePublicAccountPolicyType);
180 validator->ValidateAgainstCurrentPolicy( 179 validator->ValidateAgainstCurrentPolicy(
181 policy(), 180 policy(),
182 CloudPolicyValidatorBase::TIMESTAMP_REQUIRED, 181 CloudPolicyValidatorBase::TIMESTAMP_REQUIRED,
183 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); 182 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED);
184 validator->ValidatePayload(); 183 validator->ValidatePayload();
185 validator->ValidateSignature(*key->public_key(), false); 184 validator->ValidateSignature(*key->public_key(), false);
186 validator.release()->StartValidation(callback); 185 validator.release()->StartValidation(callback);
187 } 186 }
188 187
189 } // namespace policy 188 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698