Chromium Code Reviews| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 "enterprise.user"; | 321 "enterprise.user"; |
| 322 const char EnterpriseInstallAttributes::kAttrConsumerKioskEnabled[] = | 322 const char EnterpriseInstallAttributes::kAttrConsumerKioskEnabled[] = |
| 323 "consumer.app_kiosk_enabled"; | 323 "consumer.app_kiosk_enabled"; |
| 324 | 324 |
| 325 std::string EnterpriseInstallAttributes::GetDeviceModeString(DeviceMode mode) { | 325 std::string EnterpriseInstallAttributes::GetDeviceModeString(DeviceMode mode) { |
| 326 switch (mode) { | 326 switch (mode) { |
| 327 case DEVICE_MODE_CONSUMER: | 327 case DEVICE_MODE_CONSUMER: |
| 328 return EnterpriseInstallAttributes::kConsumerDeviceMode; | 328 return EnterpriseInstallAttributes::kConsumerDeviceMode; |
| 329 case DEVICE_MODE_ENTERPRISE: | 329 case DEVICE_MODE_ENTERPRISE: |
| 330 return EnterpriseInstallAttributes::kEnterpriseDeviceMode; | 330 return EnterpriseInstallAttributes::kEnterpriseDeviceMode; |
| 331 case DEVICE_MODE_RETAIL_KIOSK: | 331 case DEVICE_MODE_LEGACY_RETAIL_MODE: |
| 332 return EnterpriseInstallAttributes::kRetailKioskDeviceMode; | 332 return EnterpriseInstallAttributes::kRetailKioskDeviceMode; |
|
bartfab (slow)
2014/11/27 16:25:47
Nit: The |kRetailKioskDeviceMode| constant should
rkc
2014/12/01 19:15:04
Done.
| |
| 333 case DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH: | 333 case DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH: |
| 334 return EnterpriseInstallAttributes::kConsumerKioskDeviceMode; | 334 return EnterpriseInstallAttributes::kConsumerKioskDeviceMode; |
| 335 case DEVICE_MODE_PENDING: | 335 case DEVICE_MODE_PENDING: |
| 336 case DEVICE_MODE_NOT_SET: | 336 case DEVICE_MODE_NOT_SET: |
| 337 break; | 337 break; |
| 338 } | 338 } |
| 339 NOTREACHED() << "Invalid device mode: " << mode; | 339 NOTREACHED() << "Invalid device mode: " << mode; |
| 340 return EnterpriseInstallAttributes::kUnknownDeviceMode; | 340 return EnterpriseInstallAttributes::kUnknownDeviceMode; |
| 341 } | 341 } |
| 342 | 342 |
| 343 DeviceMode EnterpriseInstallAttributes::GetDeviceModeFromString( | 343 DeviceMode EnterpriseInstallAttributes::GetDeviceModeFromString( |
| 344 const std::string& mode) { | 344 const std::string& mode) { |
| 345 if (mode == EnterpriseInstallAttributes::kConsumerDeviceMode) | 345 if (mode == EnterpriseInstallAttributes::kConsumerDeviceMode) |
| 346 return DEVICE_MODE_CONSUMER; | 346 return DEVICE_MODE_CONSUMER; |
| 347 else if (mode == EnterpriseInstallAttributes::kEnterpriseDeviceMode) | 347 else if (mode == EnterpriseInstallAttributes::kEnterpriseDeviceMode) |
| 348 return DEVICE_MODE_ENTERPRISE; | 348 return DEVICE_MODE_ENTERPRISE; |
| 349 else if (mode == EnterpriseInstallAttributes::kRetailKioskDeviceMode) | 349 else if (mode == EnterpriseInstallAttributes::kRetailKioskDeviceMode) |
| 350 return DEVICE_MODE_RETAIL_KIOSK; | 350 return DEVICE_MODE_LEGACY_RETAIL_MODE; |
| 351 else if (mode == EnterpriseInstallAttributes::kConsumerKioskDeviceMode) | 351 else if (mode == EnterpriseInstallAttributes::kConsumerKioskDeviceMode) |
| 352 return DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; | 352 return DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; |
| 353 NOTREACHED() << "Unknown device mode string: " << mode; | 353 NOTREACHED() << "Unknown device mode string: " << mode; |
| 354 return DEVICE_MODE_NOT_SET; | 354 return DEVICE_MODE_NOT_SET; |
| 355 } | 355 } |
| 356 | 356 |
| 357 void EnterpriseInstallAttributes::DecodeInstallAttributes( | 357 void EnterpriseInstallAttributes::DecodeInstallAttributes( |
| 358 const std::map<std::string, std::string>& attr_map) { | 358 const std::map<std::string, std::string>& attr_map) { |
| 359 std::string enterprise_owned; | 359 std::string enterprise_owned; |
| 360 std::string enterprise_user; | 360 std::string enterprise_user; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 388 &consumer_kiosk_enabled) && | 388 &consumer_kiosk_enabled) && |
| 389 consumer_kiosk_enabled == "true") { | 389 consumer_kiosk_enabled == "true") { |
| 390 registration_mode_ = DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; | 390 registration_mode_ = DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH; |
| 391 } else if (enterprise_user.empty() && enterprise_owned != "true") { | 391 } else if (enterprise_user.empty() && enterprise_owned != "true") { |
| 392 // |registration_user_| is empty on consumer devices. | 392 // |registration_user_| is empty on consumer devices. |
| 393 registration_mode_ = DEVICE_MODE_CONSUMER; | 393 registration_mode_ = DEVICE_MODE_CONSUMER; |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 | 396 |
| 397 } // namespace policy | 397 } // namespace policy |
| OLD | NEW |