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

Unified Diff: components/policy/tools/generate_policy_source.py

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed another test. Created 5 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/generate_policy_source.py
diff --git a/components/policy/tools/generate_policy_source.py b/components/policy/tools/generate_policy_source.py
index 105a8606721ccff5ebf6f72953f29619ba1a0966..e7447586617b79af238f9e8722173004f9042d2a 100755
--- a/components/policy/tools/generate_policy_source.py
+++ b/components/policy/tools/generate_policy_source.py
@@ -639,6 +639,7 @@ def _WritePolicyConstantSource(policies, os, f):
'#include <climits>\n'
'\n'
'#include "base/logging.h"\n'
+ '#include "components/policy/core/common/policy_types.h"\n'
'#include "components/policy/core/common/schema_internal.h"\n'
'\n'
'namespace policy {\n'
@@ -719,6 +720,7 @@ def _WritePolicyConstantSource(policies, os, f):
' policy_map->Set(key::k%s,\n'
' POLICY_LEVEL_MANDATORY,\n'
' POLICY_SCOPE_USER,\n'
+ ' POLICY_SOURCE_ENTERPRISE_DEFAULT,\n'
' %s,\n'
' NULL);\n'
' }\n' % (policy.name, policy.name, creation_expression))
@@ -899,6 +901,7 @@ CPP_HEAD = '''
#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_types.h"
#include "policy/policy_constants.h"
#include "policy/proto/cloud_policy.pb.h"
@@ -1006,9 +1009,12 @@ def _WritePolicyCode(f, policy):
f.write(' if (value) {\n')
f.write(' ExternalDataFetcher* external_data_fetcher = %s;\n' %
_CreateExternalDataFetcher(policy.policy_type, policy.name))
- f.write(' map->Set(key::k%s, level, POLICY_SCOPE_USER,\n' %
- policy.name)
- f.write(' value, external_data_fetcher);\n'
+ f.write(' map->Set(key::k%s, \n' % policy.name)
+ f.write(' level, \n'
+ ' POLICY_SCOPE_USER, \n'
+ ' POLICY_SOURCE_CLOUD, \n'
+ ' value, \n'
+ ' external_data_fetcher);\n'
' }\n'
' }\n'
' }\n'
« no previous file with comments | « components/policy/core/common/schema_registry_tracking_policy_provider_unittest.cc ('k') | components/policy_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698