Add an implementation path option to json_schema_compiler

This replaces the hard-coded chrome/browser/extensions/api path with
a command-line option (impl_dir).

BUG=349019

Review URL: https://codereview.chromium.org/183763032

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254995 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/build/json_schema_compile.gypi b/build/json_schema_compile.gypi
index 4f1c295e..c446603 100644
--- a/build/json_schema_compile.gypi
+++ b/build/json_schema_compile.gypi
@@ -9,8 +9,11 @@
     #   cc_dir: path to generated files
     #   root_namespace: the C++ namespace that all generated files go under
     # Functions and namespaces can be excluded by setting "nocompile" to true.
+    # The default root path of API implementation sources is
+    # chrome/browser/extensions/api and can be overridden by setting "impl_dir".
     'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler',
     'api_gen': '<(api_gen_dir)/compiler.py',
+    'impl_dir%': 'chrome/browser/extensions/api',
   },
   'rules': [
     {
@@ -47,6 +50,7 @@
         '--destdir=<(SHARED_INTERMEDIATE_DIR)',
         '--namespace=<(root_namespace)',
         '--generator=cpp',
+        '--impl-dir=<(impl_dir)'
       ],
       'message': 'Generating C++ code from <(RULE_INPUT_PATH) json files',
       'process_outputs_as_sources': 1,
@@ -85,6 +89,7 @@
         '--destdir=<(SHARED_INTERMEDIATE_DIR)',
         '--namespace=<(root_namespace)',
         '--generator=cpp',
+        '--impl-dir=<(impl_dir)'
       ],
       'message': 'Generating C++ code from <(RULE_INPUT_PATH) IDL files',
       'process_outputs_as_sources': 1,