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

Unified Diff: tools/json_schema_compiler/schema_bundle_generator.py

Issue 10659021: Move chrome.appWindow to chrome.app.window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 8 years, 5 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: tools/json_schema_compiler/schema_bundle_generator.py
diff --git a/tools/json_schema_compiler/schema_bundle_generator.py b/tools/json_schema_compiler/schema_bundle_generator.py
index 759bbb835a909f79cffbf2e9591adf8d8cea02e1..41dd734d58e5c1c28b53cc9f093a8dcd5461eb77 100644
--- a/tools/json_schema_compiler/schema_bundle_generator.py
+++ b/tools/json_schema_compiler/schema_bundle_generator.py
@@ -4,6 +4,8 @@
import code
import cpp_util
+from schema_util import CapitalizeFirstLetter
+from schema_util import JsFunctionNameToClassName
import json
import os
@@ -68,23 +70,20 @@ class SchemaBundleGenerator(object):
c.Append()
return self.GenerateHeader('generated_api', c)
- def CapitalizeFirstLetter(self, value):
- return value[0].capitalize() + value[1:]
-
def GenerateFunctionRegistry(self):
c = code.Code()
c.Sblock("class GeneratedFunctionRegistry {")
c.Append("public:")
c.Sblock("static void RegisterAll(ExtensionFunctionRegistry* registry) {")
for namespace in self._model.namespaces.values():
- namespace_name = self.CapitalizeFirstLetter(namespace.name.replace(
+ namespace_name = CapitalizeFirstLetter(namespace.name.replace(
"experimental.", ""))
for function in namespace.functions.values():
if function.nocompile:
continue
- function_name = namespace_name + self.CapitalizeFirstLetter(
- function.name)
- c.Append("registry->RegisterFunction<%sFunction>();" % function_name)
+ function_name = JsFunctionNameToClassName(namespace.name, function.name)
+ c.Append("registry->RegisterFunction<%sFunction>();" % (
+ function_name))
c.Eblock("}")
c.Eblock("};")
c.Append()
« no previous file with comments | « chrome/test/data/extensions/platform_apps/windows_api/test.js ('k') | tools/json_schema_compiler/schema_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698