OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/policy/policy_util.h" |
| 6 |
| 7 #include "policy/proto/device_management_backend.pb.h" |
| 8 |
| 9 namespace em = enterprise_management; |
| 10 |
| 11 namespace policy { |
| 12 |
| 13 // static |
| 14 bool PolicyUtil::IsConsumerManaged(const em::PolicyData& policy_data) { |
| 15 return policy_data.management_mode() == em::PolicyData::CONSUMER_MANAGED; |
| 16 } |
| 17 |
| 18 // static |
| 19 bool PolicyUtil::IsEnterpriseManaged(const em::PolicyData& policy_data) { |
| 20 return policy_data.has_management_mode() ? |
| 21 policy_data.management_mode() == em::PolicyData::ENTERPRISE_MANAGED : |
| 22 policy_data.has_request_token(); |
| 23 } |
| 24 |
| 25 // static |
| 26 bool PolicyUtil::IsLocalOwned(const em::PolicyData& policy_data) { |
| 27 return policy_data.has_management_mode() ? |
| 28 policy_data.management_mode() == em::PolicyData::LOCAL_OWNER : |
| 29 !policy_data.has_request_token(); |
| 30 } |
| 31 |
| 32 } // namespace policy |
OLD | NEW |