| 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 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // Checks whether this is an enterprise device. | 77 // Checks whether this is an enterprise device. |
| 78 bool IsEnterpriseDevice() const; | 78 bool IsEnterpriseDevice() const; |
| 79 | 79 |
| 80 // Checks whether this is a consumer kiosk enabled device. | 80 // Checks whether this is a consumer kiosk enabled device. |
| 81 bool IsConsumerKioskDeviceWithAutoLaunch(); | 81 bool IsConsumerKioskDeviceWithAutoLaunch(); |
| 82 | 82 |
| 83 // Gets the domain this device belongs to or an empty string if the device is | 83 // Gets the domain this device belongs to or an empty string if the device is |
| 84 // not an enterprise device. | 84 // not an enterprise device. |
| 85 std::string GetDomain() const; | 85 std::string GetDomain() const; |
| 86 | 86 |
| 87 // Gets the user that registered the device. Returns an empty string if the | |
| 88 // device is not an enterprise device. | |
| 89 std::string GetRegistrationUser(); | |
| 90 | |
| 91 // Gets the device id that was generated when the device was registered. | 87 // Gets the device id that was generated when the device was registered. |
| 92 // Returns an empty string if the device is not an enterprise device or the | 88 // Returns an empty string if the device is not an enterprise device or the |
| 93 // device id was not stored in the lockbox (prior to R19). | 89 // device id was not stored in the lockbox (prior to R19). |
| 94 std::string GetDeviceId(); | 90 std::string GetDeviceId(); |
| 95 | 91 |
| 96 // Gets the mode the device was enrolled to. The return value for devices that | 92 // Gets the mode the device was enrolled to. The return value for devices that |
| 97 // are not locked yet will be DEVICE_MODE_UNKNOWN. | 93 // are not locked yet will be DEVICE_MODE_UNKNOWN. |
| 98 DeviceMode GetMode(); | 94 DeviceMode GetMode(); |
| 99 | 95 |
| 100 protected: | 96 protected: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 112 bool device_lock_running_; | 108 bool device_lock_running_; |
| 113 | 109 |
| 114 std::string registration_user_; | 110 std::string registration_user_; |
| 115 std::string registration_domain_; | 111 std::string registration_domain_; |
| 116 std::string registration_device_id_; | 112 std::string registration_device_id_; |
| 117 DeviceMode registration_mode_; | 113 DeviceMode registration_mode_; |
| 118 | 114 |
| 119 private: | 115 private: |
| 120 FRIEND_TEST_ALL_PREFIXES(EnterpriseInstallAttributesTest, | 116 FRIEND_TEST_ALL_PREFIXES(EnterpriseInstallAttributesTest, |
| 121 DeviceLockedFromOlderVersion); | 117 DeviceLockedFromOlderVersion); |
| 118 FRIEND_TEST_ALL_PREFIXES(EnterpriseInstallAttributesTest, |
| 119 GetRegistrationUser); |
| 122 FRIEND_TEST_ALL_PREFIXES(EnterpriseInstallAttributesTest, Init); | 120 FRIEND_TEST_ALL_PREFIXES(EnterpriseInstallAttributesTest, Init); |
| 123 FRIEND_TEST_ALL_PREFIXES(EnterpriseInstallAttributesTest, | 121 FRIEND_TEST_ALL_PREFIXES(EnterpriseInstallAttributesTest, |
| 124 InitForConsumerKiosk); | 122 InitForConsumerKiosk); |
| 123 FRIEND_TEST_ALL_PREFIXES(EnterpriseInstallAttributesTest, LockCanonicalize); |
| 125 FRIEND_TEST_ALL_PREFIXES(EnterpriseInstallAttributesTest, | 124 FRIEND_TEST_ALL_PREFIXES(EnterpriseInstallAttributesTest, |
| 126 VerifyFakeInstallAttributesCache); | 125 VerifyFakeInstallAttributesCache); |
| 127 | 126 |
| 128 // Constants for the possible device modes that can be stored in the lockbox. | 127 // Constants for the possible device modes that can be stored in the lockbox. |
| 129 static const char kConsumerDeviceMode[]; | 128 static const char kConsumerDeviceMode[]; |
| 130 static const char kEnterpriseDeviceMode[]; | 129 static const char kEnterpriseDeviceMode[]; |
| 131 static const char kLegacyRetailDeviceMode[]; | 130 static const char kLegacyRetailDeviceMode[]; |
| 132 static const char kConsumerKioskDeviceMode[]; | 131 static const char kConsumerKioskDeviceMode[]; |
| 133 static const char kUnknownDeviceMode[]; | 132 static const char kUnknownDeviceMode[]; |
| 134 | 133 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // for the result. Asynchronously retry |dbus_retries| times in case of DBUS | 173 // for the result. Asynchronously retry |dbus_retries| times in case of DBUS |
| 175 // errors (cryptohomed startup is slow). | 174 // errors (cryptohomed startup is slow). |
| 176 void TriggerConsistencyCheck(int dbus_retries); | 175 void TriggerConsistencyCheck(int dbus_retries); |
| 177 | 176 |
| 178 // Callback for TpmIsOwned() DBUS call. Generates UMA or schedules retry in | 177 // Callback for TpmIsOwned() DBUS call. Generates UMA or schedules retry in |
| 179 // case of DBUS error. | 178 // case of DBUS error. |
| 180 void OnTpmOwnerCheckCompleted(int dbus_retries_remaining, | 179 void OnTpmOwnerCheckCompleted(int dbus_retries_remaining, |
| 181 chromeos::DBusMethodCallStatus call_status, | 180 chromeos::DBusMethodCallStatus call_status, |
| 182 bool result); | 181 bool result); |
| 183 | 182 |
| 183 // Gets the user that registered the device. Returns an empty string if the |
| 184 // device is not an enterprise device. |
| 185 std::string GetRegistrationUser() const; |
| 186 |
| 184 chromeos::CryptohomeClient* cryptohome_client_; | 187 chromeos::CryptohomeClient* cryptohome_client_; |
| 185 | 188 |
| 186 base::WeakPtrFactory<EnterpriseInstallAttributes> weak_ptr_factory_; | 189 base::WeakPtrFactory<EnterpriseInstallAttributes> weak_ptr_factory_; |
| 187 | 190 |
| 188 DISALLOW_COPY_AND_ASSIGN(EnterpriseInstallAttributes); | 191 DISALLOW_COPY_AND_ASSIGN(EnterpriseInstallAttributes); |
| 189 }; | 192 }; |
| 190 | 193 |
| 191 } // namespace policy | 194 } // namespace policy |
| 192 | 195 |
| 193 #endif // CHROME_BROWSER_CHROMEOS_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ | 196 #endif // CHROME_BROWSER_CHROMEOS_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ |
| OLD | NEW |