Chromium Code Reviews| Index: chrome/browser/policy/enterprise_install_attributes.h |
| diff --git a/chrome/browser/policy/enterprise_install_attributes.h b/chrome/browser/policy/enterprise_install_attributes.h |
| index 90d728a277d48dbabe7c64f767c1ae40dc5ca84e..ecb4034ec97bfaff0ff65f204d3f22255ce8af92 100644 |
| --- a/chrome/browser/policy/enterprise_install_attributes.h |
| +++ b/chrome/browser/policy/enterprise_install_attributes.h |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -10,6 +10,7 @@ |
| #include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
| +#include "chrome/browser/policy/proto/device_management_backend.pb.h" |
|
Mattias Nissler (ping if slow)
2012/02/15 15:32:03
We shouldn't depend on the proto file here. I feel
pastarmovj
2012/02/15 17:40:14
Done.
|
| namespace chromeos { |
| class CryptohomeLibrary; |
| @@ -17,6 +18,9 @@ class CryptohomeLibrary; |
| namespace policy { |
| +extern const char kEnterpiseDeviceMode[]; |
| +extern const char kKioskDeviceMode[]; |
| + |
| // Brokers access to the enterprise-related installation-time attributes on |
| // ChromeOS. |
| class EnterpriseInstallAttributes { |
| @@ -34,7 +38,10 @@ class EnterpriseInstallAttributes { |
| // Locks the device to be an enterprise device registered by the given user. |
| // This can also be called after the lock has already been taken, in which |
| // case it checks that the passed user agrees with the locked attribute. |
| - LockResult LockDevice(const std::string& user) WARN_UNUSED_RESULT; |
| + LockResult LockDevice( |
| + const std::string& user, |
| + enterprise_management::DeviceRegisterResponse_DeviceMode device_mode, |
| + const std::string& device_id) WARN_UNUSED_RESULT; |
| // Checks whether this is an enterprise device. |
| bool IsEnterpriseDevice(); |
| @@ -47,6 +54,16 @@ class EnterpriseInstallAttributes { |
| // device is not an enterprise device. |
| std::string GetRegistrationUser(); |
| + // Gets the device id that was generated when the device was registered. |
| + // Returns an empty string if the device is not an enterprise device or the |
| + // device id was not stored in the lockbox (prior to R19). |
| + std::string GetDeviceId(); |
| + |
| + // Gets the mode the device was enrolled to. The return value only makes sense |
| + // for enrolled devices. Always verify with |IsEnrolledDevice| before trusting |
| + // the output of this function! |
|
Mattias Nissler (ping if slow)
2012/02/15 15:32:03
Maybe bool GetMode(DeviceMode* mode) would be a be
pastarmovj
2012/02/15 17:40:14
Using the local enum I can have a UNKNOWN_DEVICE v
|
| + enterprise_management::DeviceRegisterResponse_DeviceMode GetMode(); |
| + |
| private: |
| // Makes sure the local caches for enterprise-related install attributes are |
| // up-to-date with what cryptohome has. |
| @@ -56,6 +73,9 @@ class EnterpriseInstallAttributes { |
| bool device_locked_; |
| std::string registration_user_; |
| + std::string registration_domain_; |
| + std::string registration_device_id_; |
| + enterprise_management::DeviceRegisterResponse_DeviceMode registration_mode_; |
| DISALLOW_COPY_AND_ASSIGN(EnterpriseInstallAttributes); |
| }; |