| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 attribute->set_name(InstallAttributes::kAttrEnterpriseOwned); | 64 attribute->set_name(InstallAttributes::kAttrEnterpriseOwned); |
| 65 attribute->set_value("true"); | 65 attribute->set_value("true"); |
| 66 | 66 |
| 67 attribute = install_attrs_proto.add_attributes(); | 67 attribute = install_attrs_proto.add_attributes(); |
| 68 attribute->set_name(InstallAttributes::kAttrEnterpriseUser); | 68 attribute->set_name(InstallAttributes::kAttrEnterpriseUser); |
| 69 attribute->set_value(user_name); | 69 attribute->set_value(user_name); |
| 70 | 70 |
| 71 return install_attrs_proto.SerializeAsString(); | 71 return install_attrs_proto.SerializeAsString(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 // static |
| 75 std::string InstallAttributes:: |
| 76 GetActiveDirectoryEnterpriseOwnedInstallAttributesBlobForTesting( |
| 77 const std::string& realm) { |
| 78 cryptohome::SerializedInstallAttributes install_attrs_proto; |
| 79 cryptohome::SerializedInstallAttributes::Attribute* attribute = nullptr; |
| 80 |
| 81 attribute = install_attrs_proto.add_attributes(); |
| 82 attribute->set_name(InstallAttributes::kAttrEnterpriseOwned); |
| 83 attribute->set_value("true"); |
| 84 |
| 85 attribute = install_attrs_proto.add_attributes(); |
| 86 attribute->set_name(InstallAttributes::kAttrEnterpriseMode); |
| 87 attribute->set_value(InstallAttributes::kEnterpriseADDeviceMode); |
| 88 |
| 89 attribute = install_attrs_proto.add_attributes(); |
| 90 attribute->set_name(InstallAttributes::kAttrEnterpriseRealm); |
| 91 attribute->set_value(realm); |
| 92 |
| 93 return install_attrs_proto.SerializeAsString(); |
| 94 } |
| 95 |
| 74 InstallAttributes::InstallAttributes(CryptohomeClient* cryptohome_client) | 96 InstallAttributes::InstallAttributes(CryptohomeClient* cryptohome_client) |
| 75 : cryptohome_client_(cryptohome_client), | 97 : cryptohome_client_(cryptohome_client), |
| 76 weak_ptr_factory_(this) { | 98 weak_ptr_factory_(this) { |
| 77 } | 99 } |
| 78 | 100 |
| 79 InstallAttributes::~InstallAttributes() {} | 101 InstallAttributes::~InstallAttributes() {} |
| 80 | 102 |
| 81 void InstallAttributes::Init(const base::FilePath& cache_file) { | 103 void InstallAttributes::Init(const base::FilePath& cache_file) { |
| 82 DCHECK(!device_locked_); | 104 DCHECK(!device_locked_); |
| 83 | 105 |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 return; | 535 return; |
| 514 } | 536 } |
| 515 | 537 |
| 516 WarnIfNonempty(attr_map, kAttrConsumerKioskEnabled); | 538 WarnIfNonempty(attr_map, kAttrConsumerKioskEnabled); |
| 517 if (user_deprecated.empty()) { | 539 if (user_deprecated.empty()) { |
| 518 registration_mode_ = policy::DEVICE_MODE_CONSUMER; | 540 registration_mode_ = policy::DEVICE_MODE_CONSUMER; |
| 519 } | 541 } |
| 520 } | 542 } |
| 521 | 543 |
| 522 } // namespace chromeos | 544 } // namespace chromeos |
| OLD | NEW |