| 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 LOG(ERROR) << "Locked data doesn't match."; | 317 LOG(ERROR) << "Locked data doesn't match."; |
| 318 device_lock_running_ = false; | 318 device_lock_running_ = false; |
| 319 callback.Run(LOCK_READBACK_ERROR); | 319 callback.Run(LOCK_READBACK_ERROR); |
| 320 return; | 320 return; |
| 321 } | 321 } |
| 322 | 322 |
| 323 device_lock_running_ = false; | 323 device_lock_running_ = false; |
| 324 callback.Run(LOCK_SUCCESS); | 324 callback.Run(LOCK_SUCCESS); |
| 325 } | 325 } |
| 326 | 326 |
| 327 bool EnterpriseInstallAttributes::IsEnterpriseDevice() { | 327 bool EnterpriseInstallAttributes::IsEnterpriseDevice() const { |
| 328 return device_locked_ && !registration_user_.empty(); | 328 return device_locked_ && !registration_user_.empty(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 bool EnterpriseInstallAttributes::IsConsumerKioskDeviceWithAutoLaunch() { | 331 bool EnterpriseInstallAttributes::IsConsumerKioskDeviceWithAutoLaunch() { |
| 332 return device_locked_ && | 332 return device_locked_ && |
| 333 registration_mode_ == DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; | 333 registration_mode_ == DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; |
| 334 } | 334 } |
| 335 | 335 |
| 336 std::string EnterpriseInstallAttributes::GetRegistrationUser() { | 336 std::string EnterpriseInstallAttributes::GetRegistrationUser() { |
| 337 if (!device_locked_) | 337 if (!device_locked_) |
| 338 return std::string(); | 338 return std::string(); |
| 339 | 339 |
| 340 return registration_user_; | 340 return registration_user_; |
| 341 } | 341 } |
| 342 | 342 |
| 343 std::string EnterpriseInstallAttributes::GetDomain() { | 343 std::string EnterpriseInstallAttributes::GetDomain() const { |
| 344 if (!IsEnterpriseDevice()) | 344 if (!IsEnterpriseDevice()) |
| 345 return std::string(); | 345 return std::string(); |
| 346 | 346 |
| 347 return registration_domain_; | 347 return registration_domain_; |
| 348 } | 348 } |
| 349 | 349 |
| 350 std::string EnterpriseInstallAttributes::GetDeviceId() { | 350 std::string EnterpriseInstallAttributes::GetDeviceId() { |
| 351 if (!IsEnterpriseDevice()) | 351 if (!IsEnterpriseDevice()) |
| 352 return std::string(); | 352 return std::string(); |
| 353 | 353 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 &consumer_kiosk_enabled) && | 488 &consumer_kiosk_enabled) && |
| 489 consumer_kiosk_enabled == "true") { | 489 consumer_kiosk_enabled == "true") { |
| 490 registration_mode_ = DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; | 490 registration_mode_ = DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; |
| 491 } else if (enterprise_user.empty() && enterprise_owned != "true") { | 491 } else if (enterprise_user.empty() && enterprise_owned != "true") { |
| 492 // |registration_user_| is empty on consumer devices. | 492 // |registration_user_| is empty on consumer devices. |
| 493 registration_mode_ = DEVICE_MODE_CONSUMER; | 493 registration_mode_ = DEVICE_MODE_CONSUMER; |
| 494 } | 494 } |
| 495 } | 495 } |
| 496 | 496 |
| 497 } // namespace policy | 497 } // namespace policy |
| OLD | NEW |