Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(705)

Side by Side Diff: chrome/browser/chromeos/policy/policy_util.cc

Issue 742513006: Add ManagementMode enum and GetManagementMode(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698