OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/policy/enterprise_install_attributes.h" | 5 #include "chrome/browser/policy/enterprise_install_attributes.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 8 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
9 | 9 |
10 static const char kAttrEnterpriseOwned[] = "enterprise.owned"; | 10 namespace { |
11 static const char kAttrEnterpriseUser[] = "enterprise.user"; | 11 |
| 12 const char kAttrEnterpriseOwned[] = "enterprise.owned"; |
| 13 const char kAttrEnterpriseUser[] = "enterprise.user"; |
| 14 |
| 15 } // namespace |
12 | 16 |
13 namespace policy { | 17 namespace policy { |
14 | 18 |
15 EnterpriseInstallAttributes::EnterpriseInstallAttributes( | 19 EnterpriseInstallAttributes::EnterpriseInstallAttributes( |
16 chromeos::CryptohomeLibrary* cryptohome) | 20 chromeos::CryptohomeLibrary* cryptohome) |
17 : cryptohome_(cryptohome), | 21 : cryptohome_(cryptohome), |
18 device_locked_(false) {} | 22 device_locked_(false) {} |
19 | 23 |
20 EnterpriseInstallAttributes::LockResult EnterpriseInstallAttributes::LockDevice( | 24 EnterpriseInstallAttributes::LockResult EnterpriseInstallAttributes::LockDevice( |
21 const std::string& user) { | 25 const std::string& user) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 cryptohome_->InstallAttributesGet(kAttrEnterpriseUser, | 107 cryptohome_->InstallAttributesGet(kAttrEnterpriseUser, |
104 &enterprise_user) && | 108 &enterprise_user) && |
105 enterprise_owned == "true" && | 109 enterprise_owned == "true" && |
106 !enterprise_user.empty()) { | 110 !enterprise_user.empty()) { |
107 registration_user_ = enterprise_user; | 111 registration_user_ = enterprise_user; |
108 } | 112 } |
109 } | 113 } |
110 } | 114 } |
111 | 115 |
112 } // namespace policy | 116 } // namespace policy |
OLD | NEW |