| OLD | NEW |
| 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/settings/install_attributes.h" | 5 #include "chrome/browser/chromeos/settings/install_attributes.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 registration_realm_ != realm || | 310 registration_realm_ != realm || |
| 311 registration_device_id_ != device_id) { | 311 registration_device_id_ != device_id) { |
| 312 LOG(ERROR) << "Locked data doesn't match."; | 312 LOG(ERROR) << "Locked data doesn't match."; |
| 313 callback.Run(LOCK_READBACK_ERROR); | 313 callback.Run(LOCK_READBACK_ERROR); |
| 314 return; | 314 return; |
| 315 } | 315 } |
| 316 | 316 |
| 317 callback.Run(LOCK_SUCCESS); | 317 callback.Run(LOCK_SUCCESS); |
| 318 } | 318 } |
| 319 | 319 |
| 320 bool InstallAttributes::IsEnterpriseDevice() const { | 320 bool InstallAttributes::IsEnterpriseManaged() const { |
| 321 if (!device_locked_) { | 321 if (!device_locked_) { |
| 322 return false; | 322 return false; |
| 323 } | 323 } |
| 324 return registration_mode_ == policy::DEVICE_MODE_ENTERPRISE || | 324 return registration_mode_ == policy::DEVICE_MODE_ENTERPRISE || |
| 325 registration_mode_ == policy::DEVICE_MODE_ENTERPRISE_AD; | 325 registration_mode_ == policy::DEVICE_MODE_ENTERPRISE_AD; |
| 326 } | 326 } |
| 327 | 327 |
| 328 bool InstallAttributes::IsActiveDirectoryManaged() const { |
| 329 if (!device_locked_) { |
| 330 return false; |
| 331 } |
| 332 return registration_mode_ == policy::DEVICE_MODE_ENTERPRISE_AD; |
| 333 } |
| 334 |
| 335 bool InstallAttributes::IsCloudManaged() const { |
| 336 if (!device_locked_) { |
| 337 return false; |
| 338 } |
| 339 return registration_mode_ == policy::DEVICE_MODE_ENTERPRISE; |
| 340 } |
| 341 |
| 328 bool InstallAttributes::IsConsumerKioskDeviceWithAutoLaunch() { | 342 bool InstallAttributes::IsConsumerKioskDeviceWithAutoLaunch() { |
| 329 return device_locked_ && | 343 return device_locked_ && |
| 330 registration_mode_ == policy::DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; | 344 registration_mode_ == policy::DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; |
| 331 } | 345 } |
| 332 | 346 |
| 333 void InstallAttributes::TriggerConsistencyCheck(int dbus_retries) { | 347 void InstallAttributes::TriggerConsistencyCheck(int dbus_retries) { |
| 334 cryptohome_client_->TpmIsOwned( | 348 cryptohome_client_->TpmIsOwned( |
| 335 base::Bind(&InstallAttributes::OnTpmOwnerCheckCompleted, | 349 base::Bind(&InstallAttributes::OnTpmOwnerCheckCompleted, |
| 336 weak_ptr_factory_.GetWeakPtr(), | 350 weak_ptr_factory_.GetWeakPtr(), |
| 337 dbus_retries)); | 351 dbus_retries)); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 return; | 513 return; |
| 500 } | 514 } |
| 501 | 515 |
| 502 WarnIfNonempty(attr_map, kAttrConsumerKioskEnabled); | 516 WarnIfNonempty(attr_map, kAttrConsumerKioskEnabled); |
| 503 if (user_deprecated.empty()) { | 517 if (user_deprecated.empty()) { |
| 504 registration_mode_ = policy::DEVICE_MODE_CONSUMER; | 518 registration_mode_ = policy::DEVICE_MODE_CONSUMER; |
| 505 } | 519 } |
| 506 } | 520 } |
| 507 | 521 |
| 508 } // namespace chromeos | 522 } // namespace chromeos |
| OLD | NEW |