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

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

Issue 1266563002: Added affiliation IDs for the new affiliation determination. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 if (device_cloud_policy_manager_) 240 if (device_cloud_policy_manager_)
241 device_cloud_policy_manager_->RemoveDeviceCloudPolicyManagerObserver(this); 241 device_cloud_policy_manager_->RemoveDeviceCloudPolicyManagerObserver(this);
242 242
243 ChromeBrowserPolicyConnector::Shutdown(); 243 ChromeBrowserPolicyConnector::Shutdown();
244 } 244 }
245 245
246 bool BrowserPolicyConnectorChromeOS::IsEnterpriseManaged() { 246 bool BrowserPolicyConnectorChromeOS::IsEnterpriseManaged() {
247 return install_attributes_ && install_attributes_->IsEnterpriseDevice(); 247 return install_attributes_ && install_attributes_->IsEnterpriseDevice();
248 } 248 }
249 249
250 std::string BrowserPolicyConnectorChromeOS::GetEnterpriseDomain() { 250 std::string BrowserPolicyConnectorChromeOS::GetEnterpriseDomain() const {
251 return install_attributes_ ? install_attributes_->GetDomain() : std::string(); 251 return install_attributes_ ? install_attributes_->GetDomain() : std::string();
252 } 252 }
253 253
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 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 device_management_service(), 373 device_management_service(),
374 consumer_device_management_service_.get(), 374 consumer_device_management_service_.get(),
375 GetBackgroundTaskRunner(), 375 GetBackgroundTaskRunner(),
376 install_attributes_.get(), 376 install_attributes_.get(),
377 state_keys_broker_.get(), 377 state_keys_broker_.get(),
378 device_cloud_policy_manager_->device_store(), 378 device_cloud_policy_manager_->device_store(),
379 device_cloud_policy_manager_)); 379 device_cloud_policy_manager_));
380 device_cloud_policy_initializer_->Init(); 380 device_cloud_policy_initializer_->Init();
381 } 381 }
382 382
383 chromeos::AffiliationIDSet
384 BrowserPolicyConnectorChromeOS::GetDeviceAffiliationIDs() const {
385 chromeos::AffiliationIDSet affiliation_ids;
386 if (device_cloud_policy_manager_) {
387 const enterprise_management::PolicyData* const policy_data =
388 device_cloud_policy_manager_->device_store()->policy();
389 if (policy_data) {
390 affiliation_ids.insert(policy_data->device_affiliation_ids().begin(),
391 policy_data->device_affiliation_ids().end());
392 }
393 }
394 return affiliation_ids;
395 }
396
383 } // namespace policy 397 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698