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

Unified Diff: components/policy/tools/template_writers/writers/chromeos_admx_writer.py

Issue 2481183002: Generate ADMX template for Chrome OS policies (Closed)
Patch Set: Couple of fixes after testing Created 3 years, 3 months 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: components/policy/tools/template_writers/writers/chromeos_admx_writer.py
diff --git a/components/policy/tools/template_writers/writers/chromeos_admx_writer.py b/components/policy/tools/template_writers/writers/chromeos_admx_writer.py
new file mode 100755
index 0000000000000000000000000000000000000000..8689f959ede2f16e1262835a102aeaaeb95e8a53
--- /dev/null
+++ b/components/policy/tools/template_writers/writers/chromeos_admx_writer.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+# Copyright 2017 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.
+
+
+import base64
+
+from writers import admx_writer
+
+
+def GetWriter(config):
+ '''Factory method for creating ADMXWriter objects for the Chrome OS platform
+ See the constructor of TemplateWriter for description of arguments.
+ '''
+ return ChromeOSADMXWriter(['chrome_os'], config)
+
+
+class ChromeOSADMXWriter(admx_writer.ADMXWriter):
+ '''Class for generating Chrome OS policy templates in the ADMX format.
+ It is used by PolicyTemplateGenerator to write ADMX files.
+ '''
+
+ # Overridden.
+ def GetClass(self, policy):
+ is_device_only = 'device_only' in policy and policy['device_only']
+ return 'Machine' if is_device_only else 'User'

Powered by Google App Engine
This is Rietveld 408576698