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

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

Issue 1240283002: Implementation of the device attributes API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extension_api
Patch Set: Fixed build. Created 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser_policy_connector_chromeos.h" 5 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 std::string BrowserPolicyConnectorChromeOS::GetDeviceAssetID() { 254 std::string BrowserPolicyConnectorChromeOS::GetDeviceAssetID() {
255 if (device_cloud_policy_manager_) { 255 if (device_cloud_policy_manager_) {
256 const enterprise_management::PolicyData* policy = 256 const enterprise_management::PolicyData* policy =
257 device_cloud_policy_manager_->device_store()->policy(); 257 device_cloud_policy_manager_->device_store()->policy();
258 if (policy && policy->has_annotated_asset_id()) 258 if (policy && policy->has_annotated_asset_id())
259 return policy->annotated_asset_id(); 259 return policy->annotated_asset_id();
260 } 260 }
261 return std::string(); 261 return std::string();
262 } 262 }
263 263
264 std::string BrowserPolicyConnectorChromeOS::GetDirectoryApiID() {
265 if (device_cloud_policy_manager_) {
266 const enterprise_management::PolicyData* policy =
267 device_cloud_policy_manager_->device_store()->policy();
268 if (policy && policy->has_directory_api_id())
269 return policy->directory_api_id();
270 }
271 return std::string();
272 }
273
264 DeviceMode BrowserPolicyConnectorChromeOS::GetDeviceMode() { 274 DeviceMode BrowserPolicyConnectorChromeOS::GetDeviceMode() {
265 return install_attributes_ ? install_attributes_->GetMode() 275 return install_attributes_ ? install_attributes_->GetMode()
266 : DEVICE_MODE_NOT_SET; 276 : DEVICE_MODE_NOT_SET;
267 } 277 }
268 278
269 EnrollmentConfig BrowserPolicyConnectorChromeOS::GetPrescribedEnrollmentConfig() 279 EnrollmentConfig BrowserPolicyConnectorChromeOS::GetPrescribedEnrollmentConfig()
270 const { 280 const {
271 if (device_cloud_policy_initializer_) 281 if (device_cloud_policy_initializer_)
272 return device_cloud_policy_initializer_->GetPrescribedEnrollmentConfig(); 282 return device_cloud_policy_initializer_->GetPrescribedEnrollmentConfig();
273 283
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 device_cloud_policy_manager_->device_store()->policy(); 398 device_cloud_policy_manager_->device_store()->policy();
389 if (policy_data) { 399 if (policy_data) {
390 affiliation_ids.insert(policy_data->device_affiliation_ids().begin(), 400 affiliation_ids.insert(policy_data->device_affiliation_ids().begin(),
391 policy_data->device_affiliation_ids().end()); 401 policy_data->device_affiliation_ids().end());
392 } 402 }
393 } 403 }
394 return affiliation_ids; 404 return affiliation_ids;
395 } 405 }
396 406
397 } // namespace policy 407 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698