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

Unified 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, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/policy_util.cc
diff --git a/chrome/browser/chromeos/policy/policy_util.cc b/chrome/browser/chromeos/policy/policy_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2b55d2a65ba728de54637be3db25265e94e751df
--- /dev/null
+++ b/chrome/browser/chromeos/policy/policy_util.cc
@@ -0,0 +1,32 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/policy/policy_util.h"
+
+#include "policy/proto/device_management_backend.pb.h"
+
+namespace em = enterprise_management;
+
+namespace policy {
+
+// static
+bool PolicyUtil::IsConsumerManaged(const em::PolicyData& policy_data) {
+ return policy_data.management_mode() == em::PolicyData::CONSUMER_MANAGED;
+}
+
+// static
+bool PolicyUtil::IsEnterpriseManaged(const em::PolicyData& policy_data) {
+ return policy_data.has_management_mode() ?
+ policy_data.management_mode() == em::PolicyData::ENTERPRISE_MANAGED :
+ policy_data.has_request_token();
+}
+
+// static
+bool PolicyUtil::IsLocalOwned(const em::PolicyData& policy_data) {
+ return policy_data.has_management_mode() ?
+ policy_data.management_mode() == em::PolicyData::LOCAL_OWNER :
+ !policy_data.has_request_token();
+}
+
+} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698