Index: chrome/common/extensions/docs/server2/features_bundle.py |
diff --git a/chrome/common/extensions/docs/server2/features_bundle.py b/chrome/common/extensions/docs/server2/features_bundle.py |
index e58c650a9a8e0d6609d463b957c40a55a4763fe9..2b3299f6431166e26c83e33603fd59859ccaff5b 100644 |
--- a/chrome/common/extensions/docs/server2/features_bundle.py |
+++ b/chrome/common/extensions/docs/server2/features_bundle.py |
@@ -6,13 +6,21 @@ import posixpath |
from compiled_file_system import SingleFile, Unicode |
from extensions_paths import ( |
- API_FEATURES, JSON_TEMPLATES, MANIFEST_FEATURES, PERMISSION_FEATURES) |
+ API_FEATURES, CHROME_API, EXTENSIONS_API, JSON_TEMPLATES, MANIFEST_FEATURES, |
+ PERMISSION_FEATURES) |
import features_utility |
from file_system import FileNotFoundError |
from future import Future |
from third_party.json_schema_compiler.json_parse import Parse |
+def _GetFeaturePaths(feature_file, *extra_paths): |
+ paths = [posixpath.join(CHROME_API, feature_file), |
+ posixpath.join(EXTENSIONS_API, feature_file)] |
Ken Rockot(use gerrit already)
2014/04/22 23:23:17
nit: It would be nice if this could just map from
|
+ paths.extend(extra_paths) |
+ return paths |
+ |
+ |
def _AddPlatformsFromDependencies(feature, |
api_features, |
manifest_features, |
@@ -39,7 +47,7 @@ def _AddPlatformsFromDependencies(feature, |
class _FeaturesCache(object): |
- def __init__(self, file_system, compiled_fs_factory, *json_paths): |
+ def __init__(self, file_system, compiled_fs_factory, json_paths): |
populate = self._CreateCache |
if len(json_paths) == 1: |
populate = SingleFile(populate) |
@@ -77,17 +85,17 @@ class FeaturesBundle(object): |
self._api_cache = _FeaturesCache( |
file_system, |
compiled_fs_factory, |
- API_FEATURES) |
+ _GetFeaturePaths(API_FEATURES)) |
self._manifest_cache = _FeaturesCache( |
file_system, |
compiled_fs_factory, |
- MANIFEST_FEATURES, |
- posixpath.join(JSON_TEMPLATES, 'manifest.json')) |
+ _GetFeaturePaths(MANIFEST_FEATURES, |
+ posixpath.join(JSON_TEMPLATES, 'manifest.json'))) |
self._permission_cache = _FeaturesCache( |
file_system, |
compiled_fs_factory, |
- PERMISSION_FEATURES, |
- posixpath.join(JSON_TEMPLATES, 'permissions.json')) |
+ _GetFeaturePaths(PERMISSION_FEATURES, |
+ posixpath.join(JSON_TEMPLATES, 'permissions.json'))) |
# Namespace the object store by the file system ID because this class is |
# used by the availability finder cross-channel. |
# TODO(kalman): Configure this at the ObjectStore level. |