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

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

Issue 17109006: Device robot refresh token integrity validation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 6 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_cloud_policy_manager_chromeos.h" 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_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 "chrome/browser/chromeos/attestation/attestation_policy_observer.h" 9 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h"
10 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" 10 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 LOG(WARNING) << "Failed to get machine id."; 150 LOG(WARNING) << "Failed to get machine id.";
151 151
152 return machine_id; 152 return machine_id;
153 } 153 }
154 154
155 // static 155 // static
156 std::string DeviceCloudPolicyManagerChromeOS::GetMachineModel() { 156 std::string DeviceCloudPolicyManagerChromeOS::GetMachineModel() {
157 return GetMachineStatistic(kMachineInfoSystemHwqual); 157 return GetMachineStatistic(kMachineInfoSystemHwqual);
158 } 158 }
159 159
160 std::string DeviceCloudPolicyManagerChromeOS::GetRobotAccountID() {
161 const enterprise_management::PolicyData* policy = device_store_->policy();
162 if (policy) {
Mattias Nissler (ping if slow) 2013/06/17 05:34:17 nit: no need for curlies, I guess you could switch
David Roche 2013/06/18 04:12:08 Done.
163 return policy->service_account_identity();
164 }
165 return std::string();
166 }
167
160 scoped_ptr<CloudPolicyClient> DeviceCloudPolicyManagerChromeOS::CreateClient() { 168 scoped_ptr<CloudPolicyClient> DeviceCloudPolicyManagerChromeOS::CreateClient() {
161 return make_scoped_ptr( 169 return make_scoped_ptr(
162 new CloudPolicyClient(GetMachineID(), GetMachineModel(), 170 new CloudPolicyClient(GetMachineID(), GetMachineModel(),
163 USER_AFFILIATION_NONE, 171 USER_AFFILIATION_NONE,
164 device_status_provider_.get(), 172 device_status_provider_.get(),
165 device_management_service_)); 173 device_management_service_));
166 } 174 }
167 175
168 void DeviceCloudPolicyManagerChromeOS::EnrollmentCompleted( 176 void DeviceCloudPolicyManagerChromeOS::EnrollmentCompleted(
169 const EnrollmentCallback& callback, 177 const EnrollmentCallback& callback,
(...skipping 23 matching lines...) Expand all
193 core()->Connect(CreateClient()); 201 core()->Connect(CreateClient());
194 core()->StartRefreshScheduler(); 202 core()->StartRefreshScheduler();
195 core()->TrackRefreshDelayPref(local_state_, 203 core()->TrackRefreshDelayPref(local_state_,
196 prefs::kDevicePolicyRefreshRate); 204 prefs::kDevicePolicyRefreshRate);
197 attestation_policy_observer_.reset( 205 attestation_policy_observer_.reset(
198 new chromeos::attestation::AttestationPolicyObserver(client())); 206 new chromeos::attestation::AttestationPolicyObserver(client()));
199 } 207 }
200 } 208 }
201 209
202 } // namespace policy 210 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698