| Index: components/policy/core/common/cloud/cloud_policy_constants.cc
|
| diff --git a/components/policy/core/common/cloud/cloud_policy_constants.cc b/components/policy/core/common/cloud/cloud_policy_constants.cc
|
| index 892deaa3ab61cd6587a6b340885c2544130cf773..e574dea6642c0edaf38460b8b6eeebaaa373394a 100644
|
| --- a/components/policy/core/common/cloud/cloud_policy_constants.cc
|
| +++ b/components/policy/core/common/cloud/cloud_policy_constants.cc
|
| @@ -6,7 +6,11 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/command_line.h"
|
| +#include "base/logging.h"
|
| #include "components/policy/core/common/policy_switches.h"
|
| +#include "policy/proto/device_management_backend.pb.h"
|
| +
|
| +namespace em = enterprise_management;
|
|
|
| namespace policy {
|
|
|
| @@ -102,4 +106,26 @@ const char* GetChromeUserPolicyType() {
|
| return dm_protocol::kChromeUserPolicyType;
|
| }
|
|
|
| +ManagementMode GetManagementMode(const em::PolicyData& policy_data) {
|
| + if (policy_data.has_management_mode()) {
|
| + switch (policy_data.management_mode()) {
|
| + case em::PolicyData::LOCAL_OWNER:
|
| + return MANAGEMENT_MODE_LOCAL;
|
| +
|
| + case em::PolicyData::ENTERPRISE_MANAGED:
|
| + return MANAGEMENT_MODE_ENTERPRISE;
|
| +
|
| + case em::PolicyData::CONSUMER_MANAGED:
|
| + return MANAGEMENT_MODE_CONSUMER;
|
| +
|
| + default:
|
| + NOTREACHED();
|
| + return MANAGEMENT_MODE_LOCAL;
|
| + }
|
| + }
|
| +
|
| + return policy_data.has_request_token() ?
|
| + MANAGEMENT_MODE_ENTERPRISE : MANAGEMENT_MODE_LOCAL;
|
| +}
|
| +
|
| } // namespace policy
|
|
|