| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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(); |
| OLD | NEW |