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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 bool EnterpriseInstallAttributes::IsEnterpriseDevice() const { | 331 bool EnterpriseInstallAttributes::IsEnterpriseDevice() const { |
332 return device_locked_ && !registration_user_.empty(); | 332 return device_locked_ && !registration_user_.empty(); |
333 } | 333 } |
334 | 334 |
335 bool EnterpriseInstallAttributes::IsConsumerKioskDeviceWithAutoLaunch() { | 335 bool EnterpriseInstallAttributes::IsConsumerKioskDeviceWithAutoLaunch() { |
336 return device_locked_ && | 336 return device_locked_ && |
337 registration_mode_ == DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; | 337 registration_mode_ == DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; |
338 } | 338 } |
339 | 339 |
340 std::string EnterpriseInstallAttributes::GetRegistrationUser() { | |
341 if (!device_locked_) | |
342 return std::string(); | |
343 | |
344 return registration_user_; | |
345 } | |
346 | |
347 std::string EnterpriseInstallAttributes::GetDomain() const { | 340 std::string EnterpriseInstallAttributes::GetDomain() const { |
348 if (!IsEnterpriseDevice()) | 341 if (!IsEnterpriseDevice()) |
349 return std::string(); | 342 return std::string(); |
350 | 343 |
351 return registration_domain_; | 344 return registration_domain_; |
352 } | 345 } |
353 | 346 |
354 std::string EnterpriseInstallAttributes::GetDeviceId() { | 347 std::string EnterpriseInstallAttributes::GetDeviceId() { |
355 if (!IsEnterpriseDevice()) | 348 if (!IsEnterpriseDevice()) |
356 return std::string(); | 349 return std::string(); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 kAttrConsumerKioskEnabled, | 483 kAttrConsumerKioskEnabled, |
491 &consumer_kiosk_enabled) && | 484 &consumer_kiosk_enabled) && |
492 consumer_kiosk_enabled == "true") { | 485 consumer_kiosk_enabled == "true") { |
493 registration_mode_ = DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; | 486 registration_mode_ = DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; |
494 } else if (enterprise_user.empty() && enterprise_owned != "true") { | 487 } else if (enterprise_user.empty() && enterprise_owned != "true") { |
495 // |registration_user_| is empty on consumer devices. | 488 // |registration_user_| is empty on consumer devices. |
496 registration_mode_ = DEVICE_MODE_CONSUMER; | 489 registration_mode_ = DEVICE_MODE_CONSUMER; |
497 } | 490 } |
498 } | 491 } |
499 | 492 |
| 493 std::string EnterpriseInstallAttributes::GetRegistrationUser() const { |
| 494 if (!device_locked_) |
| 495 return std::string(); |
| 496 |
| 497 return registration_user_; |
| 498 } |
| 499 |
500 } // namespace policy | 500 } // namespace policy |
OLD | NEW |