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

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: rebase 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 device_settings_service_->GetOwnershipStatusAsync( 161 device_settings_service_->GetOwnershipStatusAsync(
162 base::Bind(&DeviceLocalAccountPolicyStore::Validate, 162 base::Bind(&DeviceLocalAccountPolicyStore::Validate,
163 weak_factory_.GetWeakPtr(), 163 weak_factory_.GetWeakPtr(),
164 base::Passed(&policy), 164 base::Passed(&policy),
165 callback)); 165 callback));
166 } 166 }
167 167
168 void DeviceLocalAccountPolicyStore::Validate( 168 void DeviceLocalAccountPolicyStore::Validate(
169 scoped_ptr<em::PolicyFetchResponse> policy_response, 169 scoped_ptr<em::PolicyFetchResponse> policy_response,
170 const UserCloudPolicyValidator::CompletionCallback& callback, 170 const UserCloudPolicyValidator::CompletionCallback& callback,
171 chromeos::DeviceSettingsService::OwnershipStatus ownership_status, 171 chromeos::DeviceSettingsService::OwnershipStatus ownership_status) {
172 bool is_owner) {
173 DCHECK_NE(chromeos::DeviceSettingsService::OWNERSHIP_UNKNOWN, 172 DCHECK_NE(chromeos::DeviceSettingsService::OWNERSHIP_UNKNOWN,
174 ownership_status); 173 ownership_status);
175 scoped_refptr<chromeos::OwnerKey> key = 174 scoped_refptr<chromeos::OwnerKey> key =
176 device_settings_service_->GetOwnerKey(); 175 device_settings_service_->GetOwnerKey();
177 if (!key.get() || !key->public_key()) { 176 if (!key.get() || !key->public_key()) {
178 status_ = CloudPolicyStore::STATUS_BAD_STATE; 177 status_ = CloudPolicyStore::STATUS_BAD_STATE;
179 NotifyStoreLoaded(); 178 NotifyStoreLoaded();
180 return; 179 return;
181 } 180 }
182 181
183 scoped_ptr<UserCloudPolicyValidator> validator( 182 scoped_ptr<UserCloudPolicyValidator> validator(
184 UserCloudPolicyValidator::Create(policy_response.Pass())); 183 UserCloudPolicyValidator::Create(policy_response.Pass()));
185 validator->ValidateUsername(account_id_); 184 validator->ValidateUsername(account_id_);
186 validator->ValidatePolicyType(dm_protocol::kChromePublicAccountPolicyType); 185 validator->ValidatePolicyType(dm_protocol::kChromePublicAccountPolicyType);
187 validator->ValidateAgainstCurrentPolicy( 186 validator->ValidateAgainstCurrentPolicy(
188 policy(), 187 policy(),
189 CloudPolicyValidatorBase::TIMESTAMP_REQUIRED, 188 CloudPolicyValidatorBase::TIMESTAMP_REQUIRED,
190 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); 189 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED);
191 validator->ValidatePayload(); 190 validator->ValidatePayload();
192 validator->ValidateSignature(*key->public_key(), false); 191 validator->ValidateSignature(*key->public_key(), false);
193 validator.release()->StartValidation(callback); 192 validator.release()->StartValidation(callback);
194 } 193 }
195 194
196 } // namespace policy 195 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698