| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import code | 5 import code |
| 6 import cpp_util | 6 import cpp_util |
| 7 from model import Platforms | 7 from model import Platforms |
| 8 from schema_util import CapitalizeFirstLetter | 8 from schema_util import CapitalizeFirstLetter |
| 9 from schema_util import JsFunctionNameToClassName | 9 from schema_util import JsFunctionNameToClassName |
| 10 | 10 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 ifdefs = self._bundle._GetPlatformIfdefs(namespace) | 196 ifdefs = self._bundle._GetPlatformIfdefs(namespace) |
| 197 if ifdefs is not None: | 197 if ifdefs is not None: |
| 198 c.Append("#if %s" % ifdefs, indent_level=0) | 198 c.Append("#if %s" % ifdefs, indent_level=0) |
| 199 | 199 |
| 200 c.Append('#include "%s"' % implementation_header) | 200 c.Append('#include "%s"' % implementation_header) |
| 201 | 201 |
| 202 if ifdefs is not None: | 202 if ifdefs is not None: |
| 203 c.Append("#endif // %s" % ifdefs, indent_level=0) | 203 c.Append("#endif // %s" % ifdefs, indent_level=0) |
| 204 c.Append() | 204 c.Append() |
| 205 c.Append('#include ' | 205 c.Append('#include ' |
| 206 '"chrome/browser/extensions/extension_function_registry.h"') | 206 '"extensions/browser/extension_function_registry.h"') |
| 207 c.Append() | 207 c.Append() |
| 208 c.Concat(cpp_util.OpenNamespace(self._bundle._cpp_namespace)) | 208 c.Concat(cpp_util.OpenNamespace(self._bundle._cpp_namespace)) |
| 209 c.Append() | 209 c.Append() |
| 210 c.Concat(self._bundle._GenerateFunctionRegistryRegisterAll()) | 210 c.Concat(self._bundle._GenerateFunctionRegistryRegisterAll()) |
| 211 c.Append() | 211 c.Append() |
| 212 c.Concat(cpp_util.CloseNamespace(self._bundle._cpp_namespace)) | 212 c.Concat(cpp_util.CloseNamespace(self._bundle._cpp_namespace)) |
| 213 c.Append() | 213 c.Append() |
| 214 return c | 214 return c |
| 215 | 215 |
| 216 | 216 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 c.Eblock('}') | 299 c.Eblock('}') |
| 300 c.Append() | 300 c.Append() |
| 301 c.Append('// static') | 301 c.Append('// static') |
| 302 c.Sblock('bool GeneratedSchemas::IsGenerated(std::string name) {') | 302 c.Sblock('bool GeneratedSchemas::IsGenerated(std::string name) {') |
| 303 c.Append('return g_lazy_instance.Get().schemas.count(name) > 0;') | 303 c.Append('return g_lazy_instance.Get().schemas.count(name) > 0;') |
| 304 c.Eblock('}') | 304 c.Eblock('}') |
| 305 c.Append() | 305 c.Append() |
| 306 c.Concat(cpp_util.CloseNamespace(self._bundle._cpp_namespace)) | 306 c.Concat(cpp_util.CloseNamespace(self._bundle._cpp_namespace)) |
| 307 c.Append() | 307 c.Append() |
| 308 return c | 308 return c |
| OLD | NEW |