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

Side by Side Diff: chrome/tools/build/generate_policy_source.py

Issue 6537020: Update policy backend and testserver for the newest policy protocol (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more last minute changes Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/policy/device_management ('k') | net/tools/testserver/device_management.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 '''python %prog [options] platform template 6 '''python %prog [options] platform template
7 7
8 platform specifies which platform source is being generated for 8 platform specifies which platform source is being generated for
9 and can be one of (win, mac, linux). 9 and can be one of (win, mac, linux).
10 template is the path to a .json policy template file.''' 10 template is the path to a .json policy template file.'''
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 #------------------ protobuf decoder -------------------------------# 219 #------------------ protobuf decoder -------------------------------#
220 CPP_HEAD = ''' 220 CPP_HEAD = '''
221 #include <limits> 221 #include <limits>
222 #include <map> 222 #include <map>
223 #include <string> 223 #include <string>
224 224
225 #include "base/logging.h" 225 #include "base/logging.h"
226 #include "base/values.h" 226 #include "base/values.h"
227 #include "chrome/browser/policy/configuration_policy_provider.h" 227 #include "chrome/browser/policy/configuration_policy_provider.h"
228 #include "chrome/browser/policy/policy_map.h" 228 #include "chrome/browser/policy/policy_map.h"
229 #include "chrome/browser/policy/proto/device_management_backend.pb.h" 229 #include "chrome/browser/policy/proto/cloud_policy.pb.h"
230 #include "policy/configuration_policy_type.h" 230 #include "policy/configuration_policy_type.h"
231 231
232 using google::protobuf::RepeatedPtrField; 232 using google::protobuf::RepeatedPtrField;
233 233
234 namespace policy { 234 namespace policy {
235 235
236 namespace em = enterprise_management; 236 namespace em = enterprise_management;
237 237
238 Value* DecodeIntegerValue(google::protobuf::int64 value) { 238 Value* DecodeIntegerValue(google::protobuf::int64 value) {
239 if (value < std::numeric_limits<int>::min() || 239 if (value < std::numeric_limits<int>::min() ||
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 for sub_policy in policy['policies']: 318 for sub_policy in policy['policies']:
319 _WritePolicyCode(f, sub_policy) 319 _WritePolicyCode(f, sub_policy)
320 else: 320 else:
321 _WritePolicyCode(f, policy) 321 _WritePolicyCode(f, policy)
322 f.write(CPP_FOOT) 322 f.write(CPP_FOOT)
323 323
324 324
325 #------------------ main() -----------------------------------------# 325 #------------------ main() -----------------------------------------#
326 if __name__ == '__main__': 326 if __name__ == '__main__':
327 main(); 327 main();
OLDNEW
« no previous file with comments | « chrome/test/data/policy/device_management ('k') | net/tools/testserver/device_management.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698