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

Unified Diff: tools/grit/grit/format/policy_templates/writers/template_writer.py

Issue 5958014: Policy: Add ProxyMode and deprecate ProxyServerMode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: check final diff Created 9 years, 11 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
« no previous file with comments | « tools/grit/grit/format/policy_templates/writers/reg_writer_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/format/policy_templates/writers/template_writer.py
diff --git a/tools/grit/grit/format/policy_templates/writers/template_writer.py b/tools/grit/grit/format/policy_templates/writers/template_writer.py
index 01c2ef48bb24e919d3aaa4779bd0ba9c3b98eb22..ecff851832e4306dde07b37624c54c9ce7a7515f 100644
--- a/tools/grit/grit/format/policy_templates/writers/template_writer.py
+++ b/tools/grit/grit/format/policy_templates/writers/template_writer.py
@@ -33,6 +33,18 @@ class TemplateWriter(object):
self.config = config
self.messages = messages
+ def IsDeprecatedPolicySupported(self, policy):
+ '''Checks if the given deprecated policy is supported by the writer.
+
+ Args:
+ policy: The dictionary of the policy.
+
+ Returns:
+ True if the writer chooses to include the deprecated 'policy' in its
+ output.
+ '''
+ return False
+
def IsPolicySupported(self, policy):
'''Checks if the given policy is supported by the writer.
In other words, the set of platforms supported by the writer
@@ -45,6 +57,10 @@ class TemplateWriter(object):
Returns:
True if the writer chooses to include 'policy' in its output.
'''
+ if ('deprecated' in policy and policy['deprecated'] is True and
+ not self.IsDeprecatedPolicySupported(policy)):
+ return False
+
if '*' in self.platforms:
# Currently chrome_os is only catched here.
return True
« no previous file with comments | « tools/grit/grit/format/policy_templates/writers/reg_writer_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698