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

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

Issue 258743005: Enable Enterprise enrollment on desktop builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added arg to PathService::OverrideAndCreateIfNeeded, added test for FakeCryptohomeClient::InstallAt… Created 6 years, 7 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/user_cloud_policy_store_chromeos.h" 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 std::string policy_blob; 312 std::string policy_blob;
313 if (!validator->policy()->SerializeToString(&policy_blob)) { 313 if (!validator->policy()->SerializeToString(&policy_blob)) {
314 status_ = STATUS_SERIALIZE_ERROR; 314 status_ = STATUS_SERIALIZE_ERROR;
315 NotifyStoreError(); 315 NotifyStoreError();
316 return; 316 return;
317 } 317 }
318 318
319 session_manager_client_->StorePolicyForUser( 319 session_manager_client_->StorePolicyForUser(
320 username_, 320 username_,
321 policy_blob, 321 policy_blob,
322 validator->policy()->new_public_key(),
323 base::Bind(&UserCloudPolicyStoreChromeOS::OnPolicyStored, 322 base::Bind(&UserCloudPolicyStoreChromeOS::OnPolicyStored,
324 weak_factory_.GetWeakPtr())); 323 weak_factory_.GetWeakPtr()));
325 } 324 }
326 325
327 void UserCloudPolicyStoreChromeOS::OnPolicyStored(bool success) { 326 void UserCloudPolicyStoreChromeOS::OnPolicyStored(bool success) {
328 if (!success) { 327 if (!success) {
329 status_ = STATUS_STORE_ERROR; 328 status_ = STATUS_STORE_ERROR;
330 NotifyStoreError(); 329 NotifyStoreError();
331 } else { 330 } else {
332 // Load the policy right after storing it, to make sure it was accepted by 331 // Load the policy right after storing it, to make sure it was accepted by
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 !sanitized_username.empty()) { 559 !sanitized_username.empty()) {
561 policy_key_path_ = user_policy_key_dir_.Append( 560 policy_key_path_ = user_policy_key_dir_.Append(
562 base::StringPrintf(kPolicyKeyFile, sanitized_username.c_str())); 561 base::StringPrintf(kPolicyKeyFile, sanitized_username.c_str()));
563 } else { 562 } else {
564 SampleValidationFailure(VALIDATION_FAILURE_DBUS); 563 SampleValidationFailure(VALIDATION_FAILURE_DBUS);
565 } 564 }
566 ReloadPolicyKey(callback); 565 ReloadPolicyKey(callback);
567 } 566 }
568 567
569 } // namespace policy 568 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698