| 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/policy/enterprise_install_attributes.h" | 5 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 void EnterpriseInstallAttributes::ReadAttributesIfReady( | 114 void EnterpriseInstallAttributes::ReadAttributesIfReady( |
| 115 const base::Closure& callback, | 115 const base::Closure& callback, |
| 116 chromeos::DBusMethodCallStatus call_status, | 116 chromeos::DBusMethodCallStatus call_status, |
| 117 bool result) { | 117 bool result) { |
| 118 if (call_status == chromeos::DBUS_METHOD_CALL_SUCCESS && result) { | 118 if (call_status == chromeos::DBUS_METHOD_CALL_SUCCESS && result) { |
| 119 registration_mode_ = DEVICE_MODE_NOT_SET; | 119 registration_mode_ = DEVICE_MODE_NOT_SET; |
| 120 if (!cryptohome_util::InstallAttributesIsInvalid() && | 120 if (!cryptohome_util::InstallAttributesIsInvalid() && |
| 121 !cryptohome_util::InstallAttributesIsFirstInstall()) { | 121 !cryptohome_util::InstallAttributesIsFirstInstall()) { |
| 122 device_locked_ = true; | 122 device_locked_ = true; |
| 123 | 123 |
| 124 static const char* kEnterpriseAttributes[] = { | 124 static const char* const kEnterpriseAttributes[] = { |
| 125 kAttrEnterpriseDeviceId, | 125 kAttrEnterpriseDeviceId, |
| 126 kAttrEnterpriseDomain, | 126 kAttrEnterpriseDomain, |
| 127 kAttrEnterpriseMode, | 127 kAttrEnterpriseMode, |
| 128 kAttrEnterpriseOwned, | 128 kAttrEnterpriseOwned, |
| 129 kAttrEnterpriseUser, | 129 kAttrEnterpriseUser, |
| 130 kAttrConsumerKioskEnabled, | 130 kAttrConsumerKioskEnabled, |
| 131 }; | 131 }; |
| 132 std::map<std::string, std::string> attr_map; | 132 std::map<std::string, std::string> attr_map; |
| 133 for (size_t i = 0; i < arraysize(kEnterpriseAttributes); ++i) { | 133 for (size_t i = 0; i < arraysize(kEnterpriseAttributes); ++i) { |
| 134 std::string value; | 134 std::string value; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 &consumer_kiosk_enabled) && | 387 &consumer_kiosk_enabled) && |
| 388 consumer_kiosk_enabled == "true") { | 388 consumer_kiosk_enabled == "true") { |
| 389 registration_mode_ = DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; | 389 registration_mode_ = DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; |
| 390 } else if (enterprise_user.empty() && enterprise_owned != "true") { | 390 } else if (enterprise_user.empty() && enterprise_owned != "true") { |
| 391 // |registration_user_| is empty on consumer devices. | 391 // |registration_user_| is empty on consumer devices. |
| 392 registration_mode_ = DEVICE_MODE_CONSUMER; | 392 registration_mode_ = DEVICE_MODE_CONSUMER; |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 | 395 |
| 396 } // namespace policy | 396 } // namespace policy |
| OLD | NEW |