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

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

Issue 2261763002: Device enterprise registration with a certificate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize pointers to nullptr. Created 4 years, 4 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
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_service.h" 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 const em::PolicyData* policy_data = device_settings_service->policy_data(); 60 const em::PolicyData* policy_data = device_settings_service->policy_data();
61 if (!policy_data || 61 if (!policy_data ||
62 !policy_data->has_request_token() || 62 !policy_data->has_request_token() ||
63 !policy_data->has_device_id() || 63 !policy_data->has_device_id() ||
64 !device_management_service) { 64 !device_management_service) {
65 return std::unique_ptr<CloudPolicyClient>(); 65 return std::unique_ptr<CloudPolicyClient>();
66 } 66 }
67 67
68 std::unique_ptr<CloudPolicyClient> client(new CloudPolicyClient( 68 std::unique_ptr<CloudPolicyClient> client(new CloudPolicyClient(
69 std::string(), std::string(), kPolicyVerificationKeyHash, 69 std::string(), std::string(), kPolicyVerificationKeyHash,
70 device_management_service, system_request_context)); 70 device_management_service, system_request_context,
71 nullptr /* signing_service */));
71 client->SetupRegistration(policy_data->request_token(), 72 client->SetupRegistration(policy_data->request_token(),
72 policy_data->device_id()); 73 policy_data->device_id());
73 return client; 74 return client;
74 } 75 }
75 76
76 // Get the subdirectory of the force-installed extension cache and the component 77 // Get the subdirectory of the force-installed extension cache and the component
77 // policy cache used for |account_id|. 78 // policy cache used for |account_id|.
78 std::string GetCacheSubdirectoryForAccountID(const std::string& account_id) { 79 std::string GetCacheSubdirectoryForAccountID(const std::string& account_id) {
79 return base::HexEncode(account_id.c_str(), account_id.size()); 80 return base::HexEncode(account_id.c_str(), account_id.size());
80 } 81 }
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 } 560 }
560 return nullptr; 561 return nullptr;
561 } 562 }
562 563
563 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated( 564 void DeviceLocalAccountPolicyService::NotifyPolicyUpdated(
564 const std::string& user_id) { 565 const std::string& user_id) {
565 FOR_EACH_OBSERVER(Observer, observers_, OnPolicyUpdated(user_id)); 566 FOR_EACH_OBSERVER(Observer, observers_, OnPolicyUpdated(user_id));
566 } 567 }
567 568
568 } // namespace policy 569 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698