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

Unified Diff: components/policy/core/common/cloud/cloud_policy_constants.h

Issue 742513006: Add ManagementMode enum and GetManagementMode(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing POLICY_EXPORT 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
« no previous file with comments | « components/components_tests.gyp ('k') | components/policy/core/common/cloud/cloud_policy_constants.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/cloud/cloud_policy_constants.h
diff --git a/components/policy/core/common/cloud/cloud_policy_constants.h b/components/policy/core/common/cloud/cloud_policy_constants.h
index b9daee29f54da6a83cb661a7f92c52d0f9d33864..1ef1ed9f809a484e1d34dfededb1d605966cdbf1 100644
--- a/components/policy/core/common/cloud/cloud_policy_constants.h
+++ b/components/policy/core/common/cloud/cloud_policy_constants.h
@@ -9,6 +9,10 @@
#include "components/policy/policy_export.h"
+namespace enterprise_management {
+class PolicyData;
+}
+
namespace policy {
// Constants related to the device management protocol.
@@ -127,6 +131,22 @@ enum DeviceMode {
// http://crbug.com/248527
POLICY_EXPORT const char* GetChromeUserPolicyType();
+// An enum that indicates if a device that has a local owner, is enterprise-
+// managed, or is consumer-managed. This is a copy of ManagementMode in
+// PolicyData. See device_management_backend.proto for the explanation of each
+// mode.
+enum ManagementMode {
+ MANAGEMENT_MODE_LOCAL_OWNER = 0,
+ MANAGEMENT_MODE_ENTERPRISE_MANAGED = 1,
+ MANAGEMENT_MODE_CONSUMER_MANAGED = 2,
+};
+
+// Returns the management mode of |policy_data|. You should use this function
+// instead of using |management_mode| in |policy_data| to handle legacy
+// |policy_data| that doesn't have |management_mode| set.
+POLICY_EXPORT ManagementMode GetManagementMode(
+ const enterprise_management::PolicyData& policy_data);
+
} // namespace policy
#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CONSTANTS_H_
« no previous file with comments | « components/components_tests.gyp ('k') | components/policy/core/common/cloud/cloud_policy_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698